apex (version 1.0.2)

multidna-class: multidna: class for multiple gene data

Description

This formal (S4) class is used to store multiple DNA alignments. Sequences are stored as a (possibly named) list, with each element of the list being a separate DNA alignment stored as a DNAbin matrix. The rows of the separate matrices all correspond to the same individuals, ordered identically.

Arguments

Slots

dna
a list of DNAbin matrices; empty slot should be NULL
labels
a vector of labels of individuals
n.ind
the number of individuals
n.seq
the total number of sequences (pooling all genes), including gap sequences
n.seq.miss
the total number of gap-only sequences
ind.info
a data.frame containing information on the individuals, where individuals are in rows; empty slot should be NULL
gene.info
a data.frame containing information on the genes, where genes are in rows; empty slot should be NULL

Examples

Run this code

## empty object
new("multidna")

## simple conversion with nicely ordered output
data(woodmouse)
genes <- list(gene1=woodmouse[,1:500], gene2=woodmouse[,501:965])
x <- new("multidna", genes)
x
image(woodmouse)
image(x@dna[[1]])
image(x@dna[[2]])

## trickier conversion with missing sequences / wrong order
genes <- list(gene1=woodmouse[,1:500], gene2=woodmouse[c(5:1,14:15),501:965])
x <- new("multidna", genes)
x
image(x@dna[[1]])
image(x@dna[[2]])

Run the code above in your browser using DataCamp Workspace