Learn R Programming

nadiv (version 2.9)

makeD: Creates the dominance genetic realationship matrix

Description

Given a pedigree, the matrix of coefficients of fraternity are returned - the D matrix. Note, no inbreeding must be assumed. Will return the inverse of the D matrix by default, otherwise this operation can be skipped if desired.

Usage

makeD(pedigree, parallel = FALSE, ncores = getOption("cores"),
      invertD = TRUE, Amethod = NULL, returnA = FALSE)

Arguments

pedigree
A pedigree with columns organized: ID, Dam, Sire
parallel
Logical, indicating whether computation should be run on multiple processors at once. See details for considerations.
ncores
Number of cores to use when parallel = TRUE. Default is maximum available. Otherwise, set with an integer. See details for considerations.
invertD
A logical indicating whether or not to invert the D matrix
Amethod
Either NULL or a character string, indicating the method to be used when creating the A matrix. If NULL and the pedigree is greater than 3000 individuals, the "flowmem" method will be used. If NULL and the pedigree is less than 3000, the "fast" method w
returnA
Logical, indicating if the numerator relationship matrix (A) should be stored and returned.

Value

  • Athe A matrix in sparse matrix form
  • Dthe D matrix in sparse matrix form
  • logDetthe log determinant of the D matrix
  • Dinvthe inverse of the D matrix in sparse matrix form
  • listDinvthe three column form of the non-zero elements for the inverse of the D matrix

Details

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

There exists no convenient method of obtaining the inverse of the dominance genetic relatedness matrix (or the D matrix itself) directly from a pedigree (such as for the inverse of A, i.e., Quaas (1995)). Therefore, this function computes the coefficient of fraternity (Lynch and Walsh, 1998) for every individual in the pedigree with a non-zero additive genetic relatedness. Note, the construction of the D matrix is more computationally demanding (in computing time and space requirements) than is the construction of A.

To overcome the computational difficulties, this function can enable parallel processing (see package multicore) to speed up the execution. Note this may not be possible on Windows (See multicore documentation for further information). If parallel = TRUE then the pacakge multicore must be loaded. The default is to use the maximum available to the machine, but this can be restricted by indicating the number desired in the argument ncores. Setting up the multi-processing takes some overhead, so no real advantage is gained for small pedigrees. Also, since all processes are sharing a fixed amount of RAM, for very large pedigrees using many processes in parallel may not be feasible due to RAM restrictions (i.e., if each process needs "n" amount of RAM to run, then ncores should be set to = total RAM/n). Otherwise the machine can become overworked.

Note, for very large pedigrees returnA should be set to FALSE to avoid drastically increasing the memory requirements while making D. When this occurs, 'NULL' is returned for the element of 'A' in the output of makeD.

References

Quaas, R.L. 1995. Fx algorithms. An unpublished note.

Lynch M., & Walsh, B. 1998. Genetics and Analysis of Quantitative Traits. Sinauer, Sunderland, Massachusetts.

See Also

makeDsim

Examples

Run this code
DinvMat <- makeD(Mrode9, parallel = FALSE)$Dinv

Run the code above in your browser using DataLab