fitness | R Documentation |
Constructor of instances of the Trait class given the focal specie and the parameters to define infinitesimal or quantitative fitness.
set_infty(specie, m = 0, a = 1, d = 0, genes = NULL) set_quant(specie, m, data)
specie |
an instance of the R6 class Specie with the genome's parameters. |
m, a, d |
a length-one numeric vector with respectively the mean, the additive and the dominant effects. |
genes |
a character vector with the putative genes. |
data |
a data frame with the genes (snp) and their additive and dominant effects |
Infinitesimal traits need the mean, the additive and the dominant effect and optionally the vector of the putative genes. Quantitative traits are defined given the mean and a data frame with the putative genes and their additive and dominant effects.
Objects of R6 class with methods to mimic in silico Traits.
data(ToyMap) spc <- set_specie(ToyMap) AA <- founder(spc, "AA") aa <- spc$founder("aa") F1 <- cross(n = 1, AA, aa) # the hybrid ## set a infinitesimal & a quantitative fitness infty <- set_infty(spc, m = 0, a = 1, d = .5) # partial dominance genes <- data.frame(snp = sample(ToyMap$snp, 10), add = rnorm(10), dom = rnorm(10)) quant <- set_quant(spc, m = 0, data = genes) ## evaluating the breeding value infty$alpha(AA) quant$alpha(F1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.