Automatic Phylogenetic Tree Generator

Generates phylogenetic trees and distance matrices from a list of taxon names, or from a higher taxon expanded down to a chosen lower rank. Trees are obtained as induced subtrees of the Open Tree of Life synthetic tree using the 'rotl' package (Michonneau, Brown and Winter, 2016, ). Expansion of a higher taxon to its descendants uses 'taxize' (Chamberlain and Szocs, 2013, ).


aptg: Automatic Phylogenetic Tree Generator

aptg builds phylogenetic trees and distance matrices from a list of taxon names, or from a higher taxon expanded down to a lower rank.

Version 0.2.x is a rewrite: the original Phylomatic/brranching backend was archived from CRAN and its web service shut down, so trees now come from the Open Tree of Life synthetic tree (via rotl) or, for ray-finned fishes, the dated Fish Tree of Life (via fishtree). See NEWS.md and MIGRATION.md for details.

Installation

# install.packages("remotes")
remotes::install_github("christophebenjamin/aptg")

# For the dated fish backend (optional):
install.packages("fishtree")

Usage

library(aptg)

# A mixed list is split by phylum: no tree ever spans above phylum.
res <- taxa.tree(c("Canis lupus", "Alces alces", "Rangifer tarandus",
                   "Acer saccharum", "Acer rubrum", "Betula alleghaniensis"))
names(res$trees)                 # "Chordata"  "Streptophyta"
plot(res$trees[["Chordata"]]$tree)
res$trees[["Chordata"]]$dist     # distance matrix

# Expand a higher taxon down to a rank, then build the tree(s).
downto.tree("Cervidae", downto = "species")

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

# Trees for a clade within a geographic area (needs rgbif; radius needs
# geosphere). Species come from GBIF occurrence records.
region.tree("Aves", lat = 45.50, lon = -73.57, radius_km = 50)  # radius
region.tree("Mammalia", province = "Nunavut")                    # Canadian territory
region.tree("Reptilia", gadm = "USA.5_1")                        # any GADM area

region.tree() supports all 13 Canadian provinces and territories by name or postal code (AB, BC, MB, NB, NL, NT, NS, NU, ON, PE, QC, SK, YT). Note that GBIF returns occurrence records, not a curated checklist, so the species list is sampling-biased — see ?region.tree.

NCBI Entrez key

downto.tree() uses NCBI via taxize. To raise the rate limit (3 to 10 req/s), pass an Entrez key as key = "..." (it is exported as ENTREZ_KEY for the call) or set ENTREZ_KEY in your .Renviron and leave key = NULL.

Return value

Both functions return, invisibly, list(trees, unmatched), where trees is named by phylum and each element is list(tree, dist). The Open Tree backend is topology-only (distances are edge counts); the fish backend returns a dated chronogram (patristic/time distances).

License

MIT (c) Christophe Benjamin. See LICENSE.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("aptg")

0.4.0 by Christophe Benjamin, 3 months ago


https://github.com/christophebenjamin/aptg


Report a bug at https://github.com/christophebenjamin/aptg/issues


Browse source code at https://github.com/cran/aptg


Authors: Christophe Benjamin [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports ape, rotl, taxize, stats

Suggests fishtree, rgbif, geosphere, testthat, knitr, rmarkdown


See at CRAN