Learn R Programming

rotl (version 3.1.1)

tol_mrca: MRCA of taxa from the synthetic tree

Description

Most Recent Common Ancestor for a set of nodes

Usage

tol_mrca(ott_ids = NULL, node_ids = NULL, ...)

# S3 method for tol_mrca tax_sources(tax, ...)

# S3 method for tol_mrca unique_name(tax, ...)

# S3 method for tol_mrca tax_name(tax, ...)

# S3 method for tol_mrca tax_rank(tax, ...)

# S3 method for tol_mrca ott_id(tax, ...)

# S3 method for tol_mrca source_list(tax, ...)

Value

An invisible list of the MRCA node properties:

mrca

List of node properties.

ott_id

Numeric. The OpenTree Taxonomy ID (ottID).

name

String. The taxonomic name of the queried node.

unique_name

String. The string that uniquely identifies the taxon in OTT.

rank

String. The taxonomic rank of the taxon in OTT.

tax_sources

List. A list of identifiers for taxonomic sources, such as other taxonomies, that define taxa judged equivalent to this taxon.

The following properties list support/conflict for the node across synthesis source trees. All properties involve sourceid keys and nodeid values (see source_id_map below) Not all properties are are present for every node.

nearest_taxon

A list of taxonomic properties of the nearest rootward taxon node to the MRCA node. Only returned if the MRCA node is a not taxon (otherwise the taxon list above is returned).

source_id_map

Named list of lists. Names correspond to the sourceid keys used in the support/conflict properties of the mrca list above. Source trees will have the following properties:

The only sourceid that does not correspond to a source tree is the taxonomy, which will have the name "ott"+`taxonomy_version`, and the value is the ott_id of the taxon in that taxonomy version. "Taxonomy" will only ever appear in supported_by.

Arguments

ott_ids

Numeric vector. The ott ids for which the MRCA is desired.

node_ids

Character vector. The node ids for which the MRCA is desired.

...

additional arguments to customize the API call (see rotl for more information).

tax

an object returned by tol_mrca().

Details

Get the MRCA of a set of nodes on the current synthetic tree. Accepts any combination of node ids and ott ids as input. Returns information about the most recent common ancestor (MRCA) node as well as the most recent taxonomic ancestor (MRTA) node (the closest taxonomic node to the MRCA node in the synthetic tree; the MRCA and MRTA may be the same node). If they are the same, the taxonomic information will be in the mrca slot, otherwise they will be in the nearest_taxon slot of the list. If any of the specified nodes is not in the synthetic tree an error will be returned.

Taxonomic methods (tax_sources(), ott_id(), unique_name(), ...) are available on the objects returned by tol_mrca(). If the MRCA node is MRTA, the name of the object returned by these methods will start with ‘ott’, otherwise it will start with ‘mrca’.

Examples

Run this code
if (FALSE) {
birds_mrca <- tol_mrca(ott_ids=c(412129, 119214))
ott_id(birds_mrca)
tax_sources(birds_mrca)
}

Run the code above in your browser using DataLab