apex (version 1.0.2)

getTree: Build phylogenies from multiple gene data

Description

This function builds separate phylogenetic trees for each gene in a multidna object, specifying a method for computing pairwise distances between individuals, and a method to build the tree from the distance matrix. By default, procedures from ape are used.

Usage

getTree(x, pool = FALSE, genes = TRUE, model = "N", pairwise.deletion = TRUE, method = nj, ladderize = TRUE, negative.branch.length = FALSE, ...)

Arguments

x
a multidna object.
pool
a logical indicating if all genes should be pooled (concatenated) to obtain a single tree; defaults to FALSE.
genes
an optional vector indicating the genes to retain for the concatenation; any way to subset the list in x@dna is acceptable; by default, all genes are used.
model
a character string passed to dist.dna describing the model to be used to compute genetic distances; defaults to 'N', the absolute number of mutations separating sequences.
pairwise.deletion
a logical passed to dist.dna indicating if pairwise deletions should be used; the alternative is to remove all sites for which at least one missing value is present.
method
a function building a tree from a matrix of pairwise genetic distances.
ladderize
a logical indicating if the tree should be ladderized; defaults to TRUE.
negative.branch.length
a logical indicating if negative branch lengths should be allowed (e.g. in the case of Neighbor-Joining reconstruction), or not, in which case they are set to 0 (FALSE, default).
...
further arguments passed to the tree reconstruction method defined by 'method'.

Value

a multiPhylo object

See Also

dist.multidna

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
plot(x)

## make trees, default parameters
trees <- getTree(x)
trees
plot(trees, type="unrooted")

## make one single tree based on concatenated genes
tree <- getTree(x, pool=TRUE)
tree
plot(tree, type="unrooted")

Run the code above in your browser using DataCamp Workspace