multidna2genind: Convert multidna into genind

Description Usage Arguments Value Author(s) See Also Examples

View source: R/exports.R

Description

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

Usage

1
2
3
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

Author(s)

Thibaut Jombart t.jombart@imperial.ac.uk, Zhian N. Kamvar, Klaus Schliep

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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)

apex documentation built on April 14, 2020, 5:32 p.m.