R: Function for creating genotype-phenotype (GP) maps
generate_gpmap
R Documentation
Function for creating genotype-phenotype (GP) maps
Description
Function for creating a gpmap object representing a genotype-phenotype (GP) map
for N biallelic loci or more generally K such maps, from a matrix of genotypic values.
A (3^NxK) matrix or numeric with each column specifying the 3^N genotypic values for K GP maps
locinames
An optional character vector with N names of loci
allelenames
An optional character object specifying allele names
mapnames
An optional character vector with K names of GP maps / phenotypes
Details
Arguments locinames and allelenames are passed on to enumerate_genotypes, and the genotypic values in y should be given
in the same sequence as the sequence of genotypes returned by enumerate_genotypes. If mapnames is not specified then the GP maps
will be named "GPmap_1", "GPmap_2",..,"GPmap_K".
Value
The function returns an object of class gpmap containing the following components
values
The vector or matrix of genotypic values
nloci
The number of loci in the map
genotypes
Data frame with enumeration of genotypes
locinames
Character vector with names for all loci
mapname
The name(s) of the GP map
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
#inter- and intra-locus additive GPmap with two loci
generate_gpmap(c(-2,1,0,-1,0,1,0,1,2),mapnames="Additive")
#two-locus GP map with AxA epistasis for loci named A and B
generate_gpmap(c(-1,0,1,0,0,0,1,0,-1),locinames=c("A","B"),mapnames="AxA")
#random GP map with 3 loci
set.seed(0)
generate_gpmap(rnorm(27))