Description Usage Arguments Value Author(s) Examples
The first three functions extract information on loci;
expand.genotype
creates a table of all possible genotypes given
a set of alleles.
1 2 3 4 | getPloidy(x)
getAlleles(x)
getGenotypes(x)
expand.genotype(n, alleles = NULL, ploidy = 2, matrix = FALSE)
|
x |
an object of class |
n |
an integer giving how many alleles to consider (ignored if
|
alleles |
the allele names as a vector of mode character. |
ploidy |
an integer giving the ploidy level (either 2 or 4 for the moment). |
matrix |
a logical specifying whether to return the genotypes in a matrix or as a character vector. |
getPloidy
returns the ploidy level of all loci in an object of
class "loci"
as a numeric vector.
getAlleles
and getGenotpes
return the alleles and
genotypes, respectively, observed in all loci in an object of class
"loci"
as a list.
expand.genotype
returns a character vector (the default) or a
matrix where the rows are the genotypes and the columns are the
alleles. The matrix is numeric by default, or character if the
argument alleles
is given.
Emmanuel Paradis
1 2 3 4 5 6 7 8 | require(adegenet)
data(nancycats)
X <- as.loci(nancycats)[, 2:3]
getAlleles(X)
getGenotypes(X)
expand.genotype(2)
expand.genotype(2, LETTERS[1:3])
expand.genotype(3, ploidy = 4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.