Function to predict the variances (and trait-trait co-variances) expected in the offspring of a cross. Takes a list of crosses to predict, marker effects, parental haplotype matrix and recombination frequency matrix as input. Predicts potentially over multiple crosses and multiple traits. When multiple traits are supplied, trait-trait co-variances are also predicted.

predCrossVars(
  CrossesToPredict,
  modelType,
  AddEffectList,
  DomEffectList = NULL,
  predType = "VPM",
  haploMat,
  recombFreqMat,
  ncores = 1,
  nBLASthreads = NULL,
  ...
)

Arguments

CrossesToPredict

data.frame or tibble, col/colnames: sireID, damID. sireID and damID must both be in the haploMat.

modelType

string, "A" or "AD", should additive only or additive and dominance variances be predicted?

AddEffectList

list of ADDITIVE effect matrices, one matrix per trait, Each element of the list is named with a string identifying the trait and the colnames of each matrix are labelled with snpIDs.

DomEffectList

list of DOMINANCE effect matrices, one matrix per trait, Each element of the list is named with a string identifying the trait and the colnames of each matrix are labelled with snpIDs.

predType,

string, default predType="VPM", "VPM" or "PMV". Choose option "VPM" if you have REML marker effect estimates (or posterior-means from MCMC) one set of marker effect estimates per trait. Variance of posterior means is faster but the alternative predType=="PMV" is expected to be less biassed. PMV requires user to supply a (probably LARGE) variance-covariance matrix of effects estimates.

haploMat

matrix of phased haplotypes, 2 rows per sample, cols = loci, 0,1, rownames assumed to contain GIDs with a suffix, separated by "_" to distinguish haplotypes

recombFreqMat

a square symmetric matrix with values = (1-2*c1), where c1=matrix of expected recomb. frequencies. The choice to do 1-2c1 outside the function was made for computation efficiency; every operation on a big matrix takes time.

ncores

number of cores, parallelizes across CrossesToPredict, in multi-trait cases, process traits for each family in serial within each worker.

nBLASthreads

number of cores for each worker to use for multi-thread BLAS

...

Value

tibble, each row contains predictions for a single cross. Columns:

  • "Nsegsnps": give the number of segregating sites in the cross and thus those used for variance predictions

  • "ComputeTime": time in minutes

  • "predVars": list-column, each element is a tibble, containing all predicted variances and covariances in a long-format.

See also

Other predCrossVar: calcCrossLD(), calcGameticLD(), predCrossMeans()