makeDomEpi {nadiv}R Documentation

Creates the additive by dominance and dominance by dominance epistatic genetic relationship matrices

Description

Given a pedigree, the matrix of additive by dominance (AD) genetic relatedness, dominance by dominance (DD) genetic relatedness, or both are returned.

Usage

makeDomEpi(
  pedigree,
  output = c("AD", "DD", "both"),
  parallel = FALSE,
  invertD = FALSE,
  det = TRUE
)

Arguments

pedigree

A pedigree where the columns are ordered ID, Dam, Sire

output

Character(s) denoting which matrix and its inverse is to be constructed.

parallel

A logical indicating whether or not to use parallel processing. Note, this may only be available on Mac and Linux operating systems.

invertD

A logical indicating whether or not to invert the D matrix

det

A logical indicating whether or not to return the determinants for the epistatic relationship matrices

Details

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

Because of the computational demands of constructing the D matrix (see makeD), this function allows for the inverses that are derived from the D matrix (i.e., D-inverse, AD-inverse, and DD-inverse)to be constructed at the same time. This way, the D matrix will only have to be constructed once for use in the three separate genetic relatedness inverse matrices that depend upon it. However, using the output and invertD options in different combinations will ensure that only the desired matrix inverses are constructed.

parallel = TRUE should only be used on Linux or Mac OSes (i.e., not Windows).

Both the AD and DD matrix are computed from the Hadamard product of the respective matrices (see also, makeAA).

Value

All of the following will be returned. However, the values of the output and invertD options passed to the function will determine which of the following are not NULL objects within the list:

D

the D matrix in sparse matrix form

logDetD

the log determinant of the D matrix

AD

the AD matrix in sparse matrix form

logDetAD

the log determinant of the AD matrix

DD

the DD matrix in sparse matrix form

logDetDD

the log determinant of the DD matrix

Dinv

the inverse of the D matrix in sparse matrix form

ADinv

the inverse of the AD matrix in sparse matrix form

DDinv

the inverse of the DD matrix in sparse matrix form

listDinv

the three column form of the non-zero elements for the inverse of the D matrix

listADinv

the three column form of the non-zero elements for the inverse of the AD matrix

listDDinv

the three column form of the non-zero elements for the inverse of the DD matrix

Author(s)

matthewwolak@gmail.com

See Also

makeA, makeD, makeAA

Examples


  Boutput <- makeDomEpi(Mrode9, output = "b", parallel = FALSE, invertD = FALSE)
  str(Boutput)
	
  DADoutput <- makeDomEpi(Mrode9, output = "AD", parallel = FALSE, invertD = TRUE)
  str(DADoutput)


[Package nadiv version 2.18.0 Index]