Constructs (non)additive genetic relationship matrices, and their inverses, from a pedigree to be used in linear mixed effect models (A.K.A. the 'animal model'). Also includes other functions to facilitate the use of animal models. Some functions have been created to be used in conjunction with the R package 'asreml' for the 'ASReml' software, which can be obtained upon purchase from 'VSN' international (< https://www.vsni.co.uk/software/asreml>).
R package that constructs (non)additive genetic relationship matrices, and their inverses, from a pedigree to be used in linear mixed effect models (A.K.A. the 'animal model'). Also includes other functions to facilitate the use of animal models. Some functions have been created to be used in conjunction with the R package for ASReml software.
From R:
install.packages("nadiv")
then select your favorite CRAN mirror
From GitHub:
devtools
package https://github.com/hadley/devtools:library(devtools); install_github("matthewwolak/nadiv")
roxygen2
documentationmakeAinv()
and makeS()
makeSd()
and makeSdsim()
makeD()
and makeDsim()
accomplish for autosomesproLik()
improved/bug fixed to find confidence limits
optimize()
quitting too early with default tol
argumentNA
if confidence limits are not, in fact, found (e.g., for boundary parameters, variances that are not significantly greater than zero)plot.proLik()
now includes vertical lines to better visualize CIsmakeAinv()
and makeD()
genAssign()
and prunePed()
genAssign.numPed()
code (and to some extent prunePed.numped()
)genAssign()
and prunePed()
are frequently called in many nadiv functions which operate on class 'numPed', this will have modest, but significant performance increasesprofvis
for bringing my attention to this!fuzz
argument.makeAinv.Rd
help file or by running the following commands in R
:?makeAinv # launches the help documentationexample(makeAinv) # runs the examples in the help documentation
* Notably, fuzzy classification can be set to 'null', where each phantom parent is assigned to one genetic group with probability=1. This produces the same **Astar** matrix as regular genetic group methods (without fuzzy classification). See this demonstrated in the examples of the help documentation.
makeAstarMult()
function to create the inverse numerator relationship matrix with genetic groups (and possibly also fuzzy classification of genetic groups) through matrix multiplication instead of using direct algorithms to set this up.
ggcontrib()
and makeAinv()
to create Q and A^-1 directly, then multiplies these in such a way as to obtain Astar.makeAstarMult.Rd
help file or run them in R
with the command:?makeAstarMult # launches the help documentationexample(makeAstarMult) # runs the examples in the help documentation
F2009
dataset
makeAinv()
)F2009.Rd
or in R type:?F2009
Add the simGG()
function to simulate pedigree and phenotype when immigration occurs in a focal population
ggTutorial
dataset (below)Added the ggTutorial
dataset
ggTutorial.Rd
or in R type:?ggTutorial
LRTest()
is now an exported function to do log-likelihood ratio testsnew S3 generic and methods for makeAinv()
.
fuzz
argument
fuzz == NULL
then dispatch the method makeAinv.default()
fuzz == "matrix" | fuzz == "Matrix"
then dispatch makeAinv.fuzzy()
fix issue with proLik()
and the confidence interval estimation
LRTest()
as basis of constrainFun()
within proLik()
so consistently define log-likelihood ratio test statisticsggcontrib()
can now incorporate fuzzy classification of genetic groups
ggcontrib()
have been changed. For more information and examples, read the help documentation ggcontrib.Rd
or in R
type:?ggcontrib # launches the help documentationexample(ggcontrib) # runs the examples in the help documentation
makeAinv()
makeAinv()
now can construct the augmented A-inverse matrix for genetic groups
makeAinv()
, however, the defaults are set to produce the normal A-inverse. For more information and examples, read the help documentation makeAinv.Rd
or in R type:?makeAinv # launches the help documentationexample("makeAinv") # runs the examples in the help documentation
makeAinv()
- significant speed-up!numPed
for pedigrees constructed by numPed()
.
is.numPed()
) and re-ordering rows (ronPed()
) currently availablenumPed
, use ronPed()
instead of typical subsetting operators (e.g., '['
) to retain the class attribute numPed
. For example:nPed <- numPed(Mrode2)is.numPed(nPed) # TRUE# re-order using typical R functionsnPed_sub <- nPed[order(nPed[, 2], nPed[, 3]), ] is.numPed(nPed_sub) # FALSE; see help via ?'[' about dropping attributes class(nPed_sub) # matrixnPed_subnadiv <- ronPed(nPed, order(nPed[, 2], nPed[, 3])) is.numPed(nPed_subnadiv) # TRUE class(nPed_subnadiv) # numPed
warcolak
dataset.
sex
are now "M"
and "F"
instead of 0
& 1
.warcolak.Rd
.Q1988
from Quaas 1988 and (2) Mrode3
from Mrode (2005) chapter 3. See their descriptions in Q1988.Rd
and Mrode3.Rd
or in R type:?Q1988?Mrode3
heterogametic
argument in makeS()
.
makeS(FG90)
won't work! Must now type:
makeS(FG90, heterogametic = "0")
as a minimum
TDtT()
, a function to take the TDT' Cholesky decomposition of a matrix (not currently exported).founderLine()
which traces all individuals back to either the paternal or maternal foundergrfx()
now has a new argument to allow user to supply the standard normal deviates instead of generating them within the function.
incidence = NULL
...
argument to drfx()
so that arguments for the internal use of grfx()
can be supplied to drfx()
.simPedHS()
or simPedDFC()
.ggcontrib()
, default is "matrix"pcc()
return FALSE
if the object (asreml) shows the log-likelihood did not convergesilent = FALSE
agrument to pcc()
so that the default can be changed to not show messages
proLik()
so that profile likelihoods should be "valleys" (instead of "hills", as they were in versions previous to 2.13.3)makeAinv()
makeA()
to use inverse of cholesky factorization of the A-inverse matrix
base::chol2inv()
to obtain A
prepPed()
to prepare pedigrees for use in other functionsmakeAinv()
ggcontrib()
so that genetic group contributions can be calculated
pin()
and pcc()
functions for the delta method and parameter value convergence checking, respectively, for asreml type REML models. Also added the pin.Rd and pcc.Rd help/documentation files.
pin()
is not exported in this version (need nadiv:::pin()
to use it)makeDufam()
, but did not export it.
makeDomEpi()
argument "Dinverse" to "invertD" to be similar to makeD()pcc()
checks to constrainFun()
so that only likelihood ratio test statistics of the constrained model returned if both the loglikelihood & parameter estimates have convergedfindDFC()
, makeD()
, makeDsim()
FindDFC()
to findDFC()