Simulate population {noia}R Documentation

Simulates a Population from a Genotype-Phenotype Map

Description

The simulatePop function takes a Genotype-to-Phenotype map (i.e. a vector defining the genotypic value of all possible genotypes) and returns a data frame containing the simulated population.

Usage

simulatePop(gmap, N = 100, sigmaE = 1, type = "F2", freqmat=NULL)

Arguments

gmap

The Genotype-to-phenotype map: a vector of size 3^L, where L is the number of loci. The vector should be named with the code of each genotype (see genNames.

N

Number of individuals.

sigmaE

Standard deviation of the environmental noise (normally distributed).

type

Type of population. "F2", "Finf", "F1", "UWR", "G2A", and "noia" are possible.

freqmat

For type="G2A": A vector of length nloc containing allele frequencies such that freqmat[i]=frequency(allele 1) for locus i.

For type="noia": A (nloc x 3) matrix of genotype frequencies such that freqmat[i,]=[frequency(1) frequency(2) frequency(3)] for locus i.

Details

The type of population refers to the expected allelic and genotypic frequences:

Value

Returns a data frame, in which the first column ($phen) contains the phenotypes, and the following ones ($Loc1, $loc2, etc) the genotypes of all individuals.

Author(s)

Arnaud Le Rouzic, Arne B. Gjuvsland

References

Alvarez-Castro JM, Carlborg O. (2007). A unified model for functional and statistical epistasis and its application in quantitative trait loci analysis. Genetics 176(2):1151-1167.

Cheverud JM, Routman, EJ. (1995). Epistasis and its contribution to genetic variance components. Genetics 139:1455-1461.

Le Rouzic A, Alvarez-Castro JM. (2008). Estimation of genetic effects and genotype-phenotype maps. Evolutionary Bioinformatics, 4.

Zeng ZB, Wang T, Zou W. (2005). Modelling quantitative trait loci and interpretation of models. Genetics 169: 1711-1725.

See Also

GPmap, genNames

Examples

set.seed(123456789)

map <- c(0.25, -0.75, -0.75, -0.75, 2.25, 2.25, -0.75, 2.25, 2.25)
pop <- simulatePop(map, N=500, sigmaE=0.2, type="F2")
str(pop)

## Create a "noia" population with genotype frequencies 1/3,1/3,1/3 for locus 1 
## and 0.2,0.6,0.2 for locus 2
pop = simulatePop(map, N=1000, sigma=1, type='noia', 
  freqmat=matrix(c(1/3,1/3,1/3,0.2,0.6,0.2),nrow=2, byrow=TRUE))

[Package noia version 0.97.3 Index]