taxa.tree: Phylogenetic trees and distance matrices from a list of taxa

View source: R/taxa.tree.R

taxa.treeR Documentation

Phylogenetic trees and distance matrices from a list of taxa

Description

Builds phylogenetic trees for a set of taxa. With the default Open Tree of Life backend, taxa are grouped by phylum and one induced subtree is built per phylum, so no tree ever spans above phylum (mammals, angiosperms, arthropods, etc. come back as separate trees). With source = "fish" a single dated tree is drawn from the Fish Tree of Life for the ray-finned fishes in the input.

Usage

taxa.tree(species, source = c("otl", "fish"), plot = TRUE, verbose = TRUE)

Arguments

species

Character vector of taxon names (typically species).

source

Tree source. "otl" (default) uses the Open Tree of Life synthetic tree via rotl (topology only, all of life). "fish" uses the Fish Tree of Life via fishtree (a dated chronogram; requires the suggested fishtree package and only covers ray-finned fishes, Actinopterygii).

plot

Logical; if TRUE (default) each tree is plotted, one panel per phylum.

verbose

Logical; print progress messages. Default TRUE.

Value

Invisibly, a list with:

trees

a named list, one element per phylum (or "Actinopterygii" for source = "fish"). Each element is itself a list with tree (a phylo) and dist (a distance matrix).

unmatched

names that could not be placed (unresolved, absent from the tree, or lacking a phylum in the Open Tree lineage).

Phylum safeguard

Different phyla have no shared, meaningfully calibrated deep phylogeny, and dated backends are clade-specific, so combining them into one tree is not sensible. To enforce this, the Open Tree backend looks up each taxon's phylum (via taxonomy_taxon_info) and builds a separate tree per phylum. A phylum with fewer than two placed taxa is skipped and reported.

Branch lengths

Open Tree induced subtrees are topology-only; unit edges are assigned when branch lengths are absent, so dist counts edges between tips. The "fish" backend returns a dated chronogram, so its dist is a patristic (time) distance.

See Also

downto.tree

Examples

## Not run: 
# Mixed mammals + plants: returns two separate trees, one per phylum.
taxa.tree(c("Canis lupus", "Canis latrans", "Acer saccharum",
            "Acer rubrum", "Alces alces", "Betula alleghaniensis"))

# Dated fish tree (needs the fishtree package):
taxa.tree(c("Thunnus thynnus", "Gadus morhua", "Danio rerio",
            "Salmo salar"), source = "fish")

## End(Not run)

aptg documentation built on July 19, 2026, 9:07 a.m.