utilities: Utily Functions for pegas

Description Usage Arguments Value Author(s) Examples

Description

The first three functions extract information on loci; expand.genotype creates a table of all possible genotypes given a set of alleles.

Usage

1
2
3
4
getPloidy(x)
getAlleles(x)
getGenotypes(x)
expand.genotype(n, alleles = NULL, ploidy = 2, matrix = FALSE)

Arguments

x

an object of class "loci".

n

an integer giving how many alleles to consider (ignored if alleles is used).

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.

Value

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.

Author(s)

Emmanuel Paradis

Examples

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)

dwinter/Pegas documentation built on May 15, 2019, 6:21 p.m.