datelife_use: Generate one or multiple chronograms for a set of given taxon...

View source: R/datelife_use.R

datelife_useR Documentation

Generate one or multiple chronograms for a set of given taxon names.

Description

datelife_use gets secondary calibrations available for any pair of given taxon names, mined from the opentree_chronograms object, congruifies them, and uses them to date a given tree topology with the algorithm defined in dating_method. If no tree topology is provided, it will attempt to get one for the given taxon names from Open Tree of Life synthetic tree, using make_bold_otol_tree().

Usage

datelife_use(input = NULL, each = FALSE, dating_method = "bladj", ...)

Arguments

input

One of the following:

A character vector

With taxon names as a single comma separated starting or concatenated with c().

A phylogenetic tree with taxon names as tip labels

As a phylo or multiPhylo object, OR as a newick character string.

A datelifeQuery object

An output from make_datelife_query().

each

Boolean, default to FALSE: all calibrations are returned in the same data.frame. If TRUE, calibrations from each chronogram are returned in separate data frames.

dating_method

Tree dating algorithm to use. Options are "bladj" or "pathd8" (Webb et al., 2008, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/bioinformatics/btn358")}; Britton et al., 2007, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/10635150701613783")}).

...

Arguments passed on to make_datelife_query

use_tnrs

Whether to use Open Tree of Life's Taxonomic Name Resolution Service (TNRS) to process input taxon names. Default to TRUE, it corrects misspellings and taxonomic name variations with tnrs_match(), a wrapper of rotl::tnrs_match_names().

get_spp_from_taxon

Whether to search ages for all species belonging to a given taxon or not. Default to FALSE. If TRUE, it must have same length as input. If input is a newick string with some clades it will be converted to a phylo object, and the order of get_spp_from_taxon will match phy$tip.label.

reference_taxonomy

A character vector specifying the reference taxonomy to use for TNRS. Options are "ott", "ncbi", "gbif" or "irmng". The function defaults to "ott".

Details

If input is a vector of taxon names, the function will attempt to reconstruct a BOLD tree with make_bold_otol_tree() to get a tree with branch lengths. If it fails, it will get an Open Tree of Life synthetic tree topology. The function then calls use_calibrations().

Value

A phylo or multiPhylo object with branch lengths proportional to time.

More

The output object stores the used calibrations and dating_method as attributes(output)$datelife_calibrations and attributes(output)$dating_method.


phylotastic/datelife documentation built on June 9, 2024, 6:50 p.m.