Description Usage Arguments Value Author(s) Examples
View source: R/genotype.index.R
Functions giving genotype indices as a function of the number of alleles (for a single locus) or the number of allele at each locus (for multiple loci).
1 2 | genotype.index(l)
genotype.index.multilocus(allele_vec,r,method)
|
l |
Number of alleles |
allele_vec |
Vector giving the number of alleles at each locus |
r |
Recombination rate. A single value between 0 and 0.5. For more than two loci, recombination rate must be set to 0.5. |
method |
A string defining the method used to store the genotypes. One of either |
For genotype.index
, a square matrix whose [i,j] element gives the index of the genotype formed by the i and j alleles.
For genotype.index.multilocus
, the value depends on the argument method
. If method = "gamete"
, it is a square matrix whose [i,j] element gives the index of the multilocus genotype formed by the i and j gametes. If method = "genotype"
, it is an n-dimensional array, where n is the number of loci, giving the index of the multilocus genotype formed by the ith single-locus genotype at the first locus, the jth single-locus genotype at the second locus, etc.
Marco Andrello
1 2 3 4 5 6 7 | # Monolocus case:
genotype.index(2)
# Multilocus case:
allele_vec <- c(2,2)
genotype.index.multilocus(allele_vec,r=0.5,method="gamete")
genotype.index.multilocus(allele_vec,r=0.5,method="genotype")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.