Learn R Programming

nadiv (version 2.9)

makeDsim: Creates the dominance genetic relationship matrix through iteration

Description

Alleles are explicitly traced through a pedigree to obtain coefficients of fraternity between pairs of individuals (the probability of sharing both alleles identical by descent). This is accomplished in an iterative process to account for the various routes by which an allele will progress through a pedigree due to Mendelian sampling. This is an implementation of the simulation approach of Ovaskainen et al. (2008).

Usage

makeDsim(pedigree, N, parallel = FALSE, ncores = getOption("cores"),
         invertD = FALSE, calcSE = FALSE, returnA = FALSE)

Arguments

pedigree
A pedigree with columns organized: ID, Dam, Sire
N
The number of times to iteratively trace alleles through the pedigree
parallel
A logical indicating whether or not to use parallel processing. Note, this may only be available for Mac and Linux operating systems.
ncores
The number of cpus to use when constructing the dominance relatedness matrix. Default is all available.
invertD
A logical indicating whether or not to invert the D matrix
calcSE
A logical indicating whether or not the standard errors for each coefficient of fraternity should be calculated
returnA
Logical, indicating if the numerator relationship matrix (A) should be stored and returned.

Value

  • Athe A matrix in sparse matrix form
  • Dthe approximate D matrix in sparse matrix form
  • logDetDthe log determinant of the approximate D matrix
  • Dinvthe inverse of the approximate D matrix in sparse matrix form
  • listDinvthe three column form of the non-zero elements for the inverse of the approximate D matrix
  • Dsimthe simulated D matrix in sparse matrix form
  • logDetDsimthe log determinant of the simulated D matrix
  • Dsiminvthe inverse of the simulated D matrix in sparse matrix form
  • listDsimthe three column form of the non-zero and non-self elements for the simulated D matrix
  • listDsiminvthe three column form of the non-zero elements for the inverse of the simulated D matrix

Details

Missing parents (e.g., base population) should be denoted by either 'NA', '0', or '*'.

If parallel = TRUE then the pacakge multicore must be loaded.

Ovaskainen et al. (2008) indicated that the method of calculating the D matrix (see makeD) is only an approximation. They proposed a simulation method that is implemented here. This should be more appropriate, especially when inbreeding occurs in the pedigree.

The value, listDsim will list both the approximate values (returned from makeD) as well as the simulated values. If calcSE is TRUE, these values will be listed in listDsim.

References

Ovaskainen, O., Cano, J.M., & Merila, J. 2008. A Bayesian framework for comparative quantitative genetics. Proceedings of the Royal Society B 275, 669-678.

See Also

makeD

Examples

Run this code
simDinvMat <- makeDsim(Mrode9, N = 1000, parallel = FALSE, invertD = FALSE, calcSE = TRUE)$listDsim

Run the code above in your browser using DataLab