enumerate_genotypes {gpmap}R Documentation

Function for enumerating genotypes for N biallelic loci

Description

Function for enumerating all 3^N genotypes for N biallelic loci. Optional specification of names of loci and alleles. genotypes. Generates a data frame of multilocus genotypes in the sequence used for objects of class gpmap.

Usage

 enumerate_genotypes(nloci=1, locinames=NULL, allelenames=NULL) 

Arguments

nloci

The number of loci N

locinames

An optional character vector with N names of loci

allelenames

An optional character object specifying allele names

Details

Unless specified locinames default to "Locus 1", "Locus 2",..,"Locus N".

If allelenames is not specified then the alleles will be named "1" and "2".

Value

Returns a data frame with locinames as colnames, and with 3^N rows specifying all possible genotypes in the sequence used for all GP maps in the package (the same sequence as used in Gjuvsland et al.( 2011)), where the genotype at the first locus varies fastest, then the second locus, and so on:

  Locus_1 Locus_2
1      11      11
2      12      11
3      22      11
4      11      12
5      12      12
6      22      12
7      11      22
8      12      22
9      22      22

Author(s)

Arne B. Gjuvsland <arne.gjuvsland@nmbu.no> and Yunpeng Wang <yunpeng.wng@gmail.com>

References

Gjuvsland AB, Vik JO, Woolliams JA, Omholt SW (2011) Order-preserving principles underlying genotype-phenotype maps ensure high additive proportions of genetic variance. Journal of Evolutionary Biology 24(10):2269-2279 [link]

Examples

#genotypes for a single locus
enumerate_genotypes()

#genotypes for two loci "A" and "B", with alleles named "H" and "L"
enumerate_genotypes(2,c("A","B"),c("H","L"))

#genotypes for the two-locus example in Cheverud & Routman (1995)
enumerate_genotypes(2,c("D7Mit17","D1Mit7"),rbind(c('A1','A2'),c('B1','B2')))

[Package gpmap version 0.1.2 Index]