fitness: Simulated Trait for Individuals According to Basic Models

fitnessR Documentation

Simulated Trait for Individuals According to Basic Models

Description

Constructor of instances of the Trait class given the focal specie and the parameters to define infinitesimal or quantitative fitness.

Usage

set_infty(specie, m = 0, a = 1, d = 0, genes = NULL)

set_quant(specie, m, data)

Arguments

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

Details

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.

Value

Objects of R6 class with methods to mimic in silico Traits.

Examples

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)


isqg documentation built on Oct. 18, 2022, 9:07 a.m.

Related to fitness in isqg...