as.loci.genalex: Convert class genalex object to data frame of class loci from...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Converts an object of class genalex to a data frame of class 'loci' from the pegas package. This data frame is similar to one of class genalex, in that it mixes genetic and other data in the same data frame, but its conversion of multiple allele columns to single genotype columns is similar to the result of the as.genetics function of this package.

Usage

1
as.loci.genalex(x, phased = FALSE, check.annotation = TRUE, ...)

Arguments

x

Annotated data frame of class genalex

phased

Still some details to work out. Default FALSE. If FALSE, assumes alleles in x are unphased so that a genotype of 101/107 is identical to a genotype of 107/101. This results in the use of "/" as the allele separator. If TRUE, uses "|" as the allele separator, and assumes alleles are phased so that a genotype of 101|107 is different from a genotype of 107/101.

check.annotation

If TRUE, the annotations for the dataset are checked using is.genalex(x, force = TRUE, skip.strings = TRUE) prior to conversion. If that returns FALSE, nothing is converted and an error is generated.

...

Additional arguments, currently ignored

Details

Like class genalex, class 'loci' can encode genotypes of any ploidy. Once a class genalex object is converted to class 'loci', it may be further converted to other data structures for analysis with pegas and adegenet.

The specific changes that occur to an object of class genalex for it to become an object of class 'loci':

Because of the removal of the sample name column and the additional allele columns, the number of columns will be reduced by 1 plus the number of loci. For further details of the structure of class loci, see http://ape-package.ird.fr/pegas/DefinitionDataClassesPegas.pdf.

Because class 'loci' can readily encode additional columns, the extra columns of a class genalex object can be bound with cbind as additional columns.

This is a specialised wrapper around the function as.loci.data.frame from the pegas package.

Value

x as an object of class 'loci', which is a data frame with the genotype of each locus encoded as factors. Additional changes apply, see Details.

Author(s)

Douglas G. Scofield

See Also

as.loci, joinGenotypes

Examples

1
2
3
4
5

douglasgscofield/readGenalex documentation built on May 15, 2019, 10:43 a.m.