phenotype: Phenotype function

View source: R/glads_funcs.R

phenotypeR Documentation

Phenotype function


A function for the computation of additive phenotypes


phenotype(G, bvs, add.loci, sex.ratio, e.v)



An object of class "struct" with the genetic structure of each individual in the population.


A matrix with the breeding values of alleles on each loci. The number of rows is equal to the number of additive loci, while the number of columns is equal to the maximum number of alleles in a locus.


An integer with the total number of additive loci participating in the computation of phenotypes.


A numerical value defining the sex ratio of populations


A numerical value defining a stochastic environmental variant in the computation of phenotypes.


This function is used internally in the function evolve() of type 'selection' in order to compute the additive phenotype value of individuals.

This phenotype function (z) focuses on an additive genetic genotype-phenotype map. The sum of values of alleles at each locus gives a breeding value (b_v) for each individual at a given locus. The sum of breeding values bvs across loci gives a breeding value for the phenotypes (z), which is computed as follows:

z = ∑_{v =1 }^{n_a} b_v + \varepsilon_e(0, σ_e)

Where n_a is equal to 'add.loci' and σ_e is equal to 'e.v'. The environmental contribution \varepsilon_e is assumed to be stochastic and normally distributed, with a mean of 0 and standard variation 'e.v'.


A data.frame with rows equal to the number of individuals and two columns ('sex' and 'z')


Quilodrán, C. S., Ruegg, K., Sendell-Price, A. T., Anderson, E., Coulson, T. and Clegg, S. (2019). The multiple population genetic and demographic routes to islands of genomic divergence. bioRxiv. doi: 10.1101/673483.

See Also

evolve fitness


## We first create a random population with 100 individuals and 10 loci
N <- 100  # Population size
nl <- 10  # Number of additive loci
na <- 4  # Number of alleles per locus
G <- initial.struct(N,nl,na)

## Additional parameters are needed for the computation of phenotypes
bvs <- t(array( seq(0,1, length = na) ,c(na, nl)))
sex.ratio <- 0.5

## Now we compute the additive phenotype value of individuals
phenotype(G, bvs, nl, sex.ratio, e.v)

eriqande/glads documentation built on April 12, 2022, 9:18 a.m.