apex (version 1.0.2)

multidna2genind: Convert multidna into genind

Description

The functions multidna2genind and multiphyDat2genind concatenates separate DNA alignments, and then extracts SNPs of the resulting alignment into a genind object.

Usage

multidna2genind(x, genes = TRUE, mlst = FALSE, gapIsNA = FALSE)
multiphyDat2genind(x, genes = TRUE, mlst = FALSE, gapIsNA = FALSE)

Arguments

x
a multidna or multiphyDat object.
genes
an optional vector indicating the genes to retain for the concatenation; any way to subset the list in x@dna or x@seq is acceptable; by default, all genes are used.
mlst
if TRUE, each gene will result in a single locus in the genind object. (Default to FALSE)
gapIsNA
if TRUE and mlst = TRUE, sequences that consist entirely of gaps will be considered as NAs. (Default to FALSE)

Value

a genind object

See Also

Examples

Run this code

## simple conversion with nicely ordered output
data(woodmouse)
genes <- list(gene1=woodmouse[,1:500], gene2=woodmouse[,501:965])
x <- new("multidna", genes)
x
y <- multidna2multiphyDat(x)
y
z1 <- multidna2genind(x)
z1
z2 <- multiphyDat2genind(y)
all.equal(z1, z2)

Run the code above in your browser using DataLab