Title: | Open Tree of Life Chronograms |
---|---|
Description: | Chronogram database constructed from Open Tree of Life's phylogenetic store. |
Authors: | Brian O'Meara [aut], Luna L. Sanchez Reyes [aut, cre] |
Maintainer: | Luna L. Sanchez Reyes <[email protected]> |
License: | GPL (>= 2) |
Version: | 2022.1.28 |
Built: | 2024-11-13 04:30:30 UTC |
Source: | https://github.com/cran/OpenTreeChronograms |
.get_ott_lineage
uses rotl::taxonomy_taxon_info()
with include_lineage = TRUE
.Get the lineage of a set of taxa.
.get_ott_lineage
uses rotl::taxonomy_taxon_info()
with include_lineage = TRUE
.
.get_ott_lineage(input_ott_match)
.get_ott_lineage(input_ott_match)
input_ott_match |
An Output of check_ott_input function. |
A taxonomy_taxon_info object
check_ott_input is currently used in functions
get_ott_clade()
,
get_ott_children()
.
check_ott_input(input = NULL, ott_ids = NULL)
check_ott_input(input = NULL, ott_ids = NULL)
input |
Optional. A character vector of names. |
ott_ids |
If not NULL, it takes this argument and ignores input. A
numeric vector of ott ids obtained with |
By default, it uses the ott_id
argument if it is not NULL.
A named numeric vector of valid Open Tree Taxonomy (OTT) ids.
This uses the taxize package's wrapper of the Global Names Resolver to get taxonomic paths for the vector of taxa you pass in. Sources is a vector of source labels in order (though it works best if everything uses the same taxonomy, so we recommend doing just one source). You can see options by doing taxize::gnr_datasources(). Our default is Catalogue of Life
classification_paths_from_taxonomy(taxa, sources = "Catalogue of Life")
classification_paths_from_taxonomy(taxa, sources = "Catalogue of Life")
taxa |
Vector of taxon names |
sources |
Vector of names of preferred sources; see taxize::gnr_datasources(). Currently supports 100 taxonomic resources, see details. |
Taxonomies supported by taxize::gnr_datasources()
Catalogue of Life
Wikispecies
ITIS
NCBI
Index Fungorum
GRIN Taxonomy for Plants
Union 4
The Interim Register of Marine and Nonmarine Genera
World Register of Marine Species
Freebase
GBIF Backbone Taxonomy
EOL
Passiflora vernacular names
Inventory of Fish Species in the Wami River Basin
Pheasant Diversity and Conservation in the Mt. Gaoligonshan Region
Finding Species
Birds of Lindi Forests Plantation
Nemertea
Kihansi Gorge Amphibian Species Checklist
Mushroom Observer
TaxonConcept
Amphibia and Reptilia of Yunnan
Common names of Chilean Plants
Invasive Species of Belgium
ZooKeys
COA Wildlife Conservation List
AskNature
China: Yunnan, Southern Gaoligongshan, Rapid Biological Inventories Report No. 04
Native Orchids from Gaoligongshan Mountains, China
Illinois Wildflowers
Coleorrhyncha Species File
/home/dimus/files/dwca/zoological names.zip
Peces de la zona hidrogeográfica de la Amazonia, Colombia (Spreadsheet)
Eastern Mediterranean Syllidae
Gaoligong Shan Medicinal Plants Checklist
birds_of_tanzania
AmphibiaWeb
tanzania_plant_sepecimens
Papahanaumokuakea Marine National Monument
Taiwanese IUCN species list
BioPedia
AnAge
Embioptera Species File
Global Invasive Species Database
Sendoya S., Fernández F. AAT de hormigas (Hymenoptera: Formicidae) del Neotrópico 1.0 2004 (Spreadsheet)
Flora of Gaoligong Mountains
ARKive
True Fruit Flies (Diptera, Tephritidae) of the Afrotropical Region
3i - Typhlocybinae Database
CATE Sphingidae
ZooBank
Diatoms
AntWeb
Endemic species in Taiwan
Dermaptera Species File
Mantodea Species File
Birds of the World: Recommended English Names
New Zealand Animalia
Blattodea Species File
Plecoptera Species File
/home/dimus/files/dwca/clemens.zip
Coreoidea Species File
Freshwater Animal Diversity Assessment - Normalized export
Catalogue of Vascular Plant Species of Central and Northeastern Brazil
Wikipedia in EOL
Database of Vascular Plants of Canada (VASCAN)
Phasmida Species File
OBIS
USDA NRCS PLANTS Database
Catalog of Fishes
Aphid Species File
The National Checklist of Taiwan
Psocodea Species File
FishBase
3i - Typhlocybinae Database
Belgian Species List
EUNIS
CU*STAR
Orthoptera Species File
Bishop Museum
IUCN Red List of Threatened Species
BioLib.cz
Tropicos - Missouri Botanical Garden
nlbif
The International Plant Names Index
Index to Organism Names
uBio NameBank
Arctos
Checklist of Beetles (Coleoptera) of Canada and Alaska. Second Edition.
The Paleobiology Database
The Reptile Database
The Mammal Species of The World
BirdLife International
Checklist da Flora de Portugal (Continental, Açores e Madeira)
FishBase Cache
Silva
Open Tree of Life Reference Taxonomy
iNaturalist
The Interim Register of Marine and Nonmarine Genera
Gymno
A list with resolved taxa (a tibble, from taxize::gnr_resolve) and a vector of taxa not resolved
Clean up some issues with Open Tree of Life chronograms For now it 1) checks unmapped taxa and maps them with tnrs_match.phylo, 2) roots the chronogram if unrooted
clean_ott_chronogram(phy)
clean_ott_chronogram(phy)
phy |
A |
There is no limit to the number of names that can be queried and matched.
The output will preserve all elements from original input phylo object and will add
A character vector indicating the state of mapping of phy$tip.labels:
Tnrs matching was not attempted. Original labeling is preserved.
Matching was manually made by a curator in Open Tree of Life.
Tnrs matching was attempted and successful with no approximate matching. Original label is replaced by the matched name.
Tnrs matching was attempted and successful but with approximate matching. Original labeling is preserved.
Tnrs matching was attempted and unsuccessful. Original labeling is preserved.
A character vector preserving all original labels.
A numeric vector with ott id numbers of matched tips. Unmatched and original tips will be NaN.
if tips are duplicated, tnrs will only be run once (avoiding increases in function running time) but the result will be applied to all duplicated tip labels
An object of class data frame or phylo, with the added class match_names.
NULL
NULL
taxonomy_taxon_info()
output.clean_taxon_info_children
eliminates all taxa that will give
problems when trying to retrieve an induced subtree from Open Tree of Life.
clean_taxon_info_children( taxon_info, invalid = c("barren", "extinct", "uncultured", "major_rank_conflict", "incertae_sedis", "unplaced", "conflict", "environmental", "not_otu", "hidden", "hybrid") )
clean_taxon_info_children( taxon_info, invalid = c("barren", "extinct", "uncultured", "major_rank_conflict", "incertae_sedis", "unplaced", "conflict", "environmental", "not_otu", "hidden", "hybrid") )
taxon_info |
An output of |
invalid |
A character vector of "flags", i.e., characteristics that are used by Open Tree of Life Taxonomy to detect invalid taxon names. |
A list with valid children unique OTT names, OTT ids and taxonomic ranks.
rotl::tnrs_match_names()
or tnrs_match()
output.
Useful to get ott ids to retrieve an induced synthetic Open Tree of Life.
Needed because using include_suppressed = FALSE
in rotl::tnrs_match_names()
does not drop all invalid taxa.Eliminates unmatched (NAs) and invalid taxa from a rotl::tnrs_match_names()
or tnrs_match()
output.
Useful to get ott ids to retrieve an induced synthetic Open Tree of Life.
Needed because using include_suppressed = FALSE
in rotl::tnrs_match_names()
does not drop all invalid taxa.
clean_tnrs( tnrs, invalid = c("barren", "extinct", "uncultured", "major_rank_conflict", "incertae", "unplaced", "conflict", "environmental", "not_otu"), remove_nonmatches = FALSE )
clean_tnrs( tnrs, invalid = c("barren", "extinct", "uncultured", "major_rank_conflict", "incertae", "unplaced", "conflict", "environmental", "not_otu"), remove_nonmatches = FALSE )
tnrs |
A |
invalid |
A character string with flags to be removed from final object. |
remove_nonmatches |
Boolean, whether to remove unsuccessfully matched names or not. |
Input can be any data frame or named list that relates taxa stored in an element named "unique" to a validity category stored in "flags".
A data.frame
or named list (depending on the input) with valid taxa only.
This will take a topology, look up information about fossils for taxa on the tree, and use paleotree::timePaleoPhy()
to compute branch lengths.
date_with_pbdb(phy, recent = FALSE, assume_recent_if_missing = TRUE)
date_with_pbdb(phy, recent = FALSE, assume_recent_if_missing = TRUE)
phy |
A |
recent |
If |
assume_recent_if_missing |
If |
A dated tree.
taxa <- c( "Archaeopteryx", "Pinus", "Quetzalcoatlus", "Homo sapiens", "Tyrannosaurus rex", "Megatheriidae", "Metasequoia", "Aedes", "Panthera" ) phy <- tree_from_taxonomy(taxa, sources = "The Paleobiology Database")$phy # end donttest
taxa <- c( "Archaeopteryx", "Pinus", "Quetzalcoatlus", "Homo sapiens", "Tyrannosaurus rex", "Megatheriidae", "Metasequoia", "Aedes", "Panthera" ) phy <- tree_from_taxonomy(taxa, sources = "The Paleobiology Database")$phy # end donttest
Get OTT ids from a character vector containing species names and OTT ids.
extract_ott_ids(x, na.rm = TRUE) ## Default S3 method: extract_ott_ids(x, na.rm = TRUE)
extract_ott_ids(x, na.rm = TRUE) ## Default S3 method: extract_ott_ids(x, na.rm = TRUE)
x |
A character vector of taxon names, or a phylo object with tip names containing OTT ids. |
na.rm |
A logical value indicating whether |
An object of class numeric containing OTT ids only.
NULL
canis <- rotl::tnrs_match_names("canis") canis_taxonomy <- rotl::taxonomy_subtree(canis$ott_id) my_ott_ids <- extract_ott_ids(x = canis_taxonomy$tip_label) # Get the problematic elements from input canis_taxonomy$tip_label[attr(my_ott_ids, "na.action")]
canis <- rotl::tnrs_match_names("canis") canis_taxonomy <- rotl::taxonomy_subtree(canis$ott_id) my_ott_ids <- extract_ott_ids(x = canis_taxonomy$tip_label) # Get the problematic elements from input canis_taxonomy$tip_label[attr(my_ott_ids, "na.action")]
This uses the Paleobiology Database's API to gather information on the ages for all specimens of a taxon. It will also look for all descendants of the taxon. It fixes name misspellings if possible.
get_fossil_range(taxon, recent = FALSE, assume_recent_if_missing = TRUE)
get_fossil_range(taxon, recent = FALSE, assume_recent_if_missing = TRUE)
taxon |
The scientific name of the taxon you want the range of occurrences of |
recent |
If TRUE, forces the minimum age to be zero |
assume_recent_if_missing |
If TRUE, any taxon missing from pbdb is assumed to be recent |
a data.frame of max_ma and min_ma for the specimens
Get all chronograms from Open Tree of Life database
get_opentree_chronograms(max_tree_count = "all") get_otol_chronograms(max_tree_count = "all")
get_opentree_chronograms(max_tree_count = "all") get_otol_chronograms(max_tree_count = "all")
max_tree_count |
Default to "all", it gets all available chronograms. For testing purposes, a numeric value indicating the max number of trees to be cached. |
A list of 4 elements:
A list of lists of author names of the original studies that published chronograms currently stored in the Open Tree of Life database.
A list of lists of curator names that uploaded chronograms to the Open Tree of Life database.
A list of study identifiers from original studies that published chronograms currently stored in the Open Tree of Life database.
A multiPhylo
object storing the chronograms from Open Tree of
Life database.
A character vector indicating the time when the database object was last updated.
A character vector indicating when the chronogram database opentree_chronograms
object was last updated. Format is year.month.day
rotl::tol_subtree()
when taxa are not in synthesis tree and
you still need to get all species or an induced OpenTree subtreeUse this instead of rotl::tol_subtree()
when taxa are not in synthesis tree and
you still need to get all species or an induced OpenTree subtree
get_ott_children(input = NULL, ott_ids = NULL, ott_rank = "species", ...)
get_ott_children(input = NULL, ott_ids = NULL, ott_rank = "species", ...)
input |
Optional. A character vector of names. |
ott_ids |
If not NULL, it takes this argument and ignores input. A
numeric vector of ott ids obtained with |
ott_rank |
A character vector with the ranks you wanna get lineage children from. |
... |
Other arguments to pass to |
A data.frame
object.
# An example with the dog genus: # It is currently not possible to get an OpenTree subtree of a taxon that is # missing from the OpenTree synthetic tree. # The dog genus is not monophyletic in the OpenTree synthetic tree, so in # practice, it has no node to extract a subtree from. # Get the Open Tree Taxonomy identifier (OTT id) for "Canis": tnrs <- tnrs_match("Canis") ## Not run: rotl::tol_subtree(tnrs$ott_id[1]) #> Error: HTTP failure: 400 #> [/v3/tree_of_life/subtree] Error: node_id was not found (broken taxon). ## End(Not run) # end dontrun ids <- tnrs$ott_id[1] names(ids) <- tnrs$unique_name children <- get_ott_children(ott_ids = ids) # or # children <- get_ott_children(input = "Canis") str(children) ids <- children$Canis$ott_id names(ids) <- rownames(children$Canis) tree_children <- rotl::tol_induced_subtree(ott_ids = ids) plot(tree_children, cex = 0.3) # An example with flowering plants: # orders <- get_ott_children(input = "magnoliophyta", ott_rank = "order") # Get the number of orders of flowering plants that we have # sum(orders$Magnoliophyta$rank == "order") # end donttest
# An example with the dog genus: # It is currently not possible to get an OpenTree subtree of a taxon that is # missing from the OpenTree synthetic tree. # The dog genus is not monophyletic in the OpenTree synthetic tree, so in # practice, it has no node to extract a subtree from. # Get the Open Tree Taxonomy identifier (OTT id) for "Canis": tnrs <- tnrs_match("Canis") ## Not run: rotl::tol_subtree(tnrs$ott_id[1]) #> Error: HTTP failure: 400 #> [/v3/tree_of_life/subtree] Error: node_id was not found (broken taxon). ## End(Not run) # end dontrun ids <- tnrs$ott_id[1] names(ids) <- tnrs$unique_name children <- get_ott_children(ott_ids = ids) # or # children <- get_ott_children(input = "Canis") str(children) ids <- children$Canis$ott_id names(ids) <- rownames(children$Canis) tree_children <- rotl::tol_induced_subtree(ott_ids = ids) plot(tree_children, cex = 0.3) # An example with flowering plants: # orders <- get_ott_children(input = "magnoliophyta", ott_rank = "order") # Get the number of orders of flowering plants that we have # sum(orders$Magnoliophyta$rank == "order") # end donttest
Get the Open Tree of Life Taxonomic identifiers (OTT ids) and name of one or several given taxonomic ranks from one or more input taxa.
get_ott_clade(input = NULL, ott_ids = NULL, ott_rank = "family")
get_ott_clade(input = NULL, ott_ids = NULL, ott_rank = "family")
input |
Optional. A character vector of names. |
ott_ids |
If not NULL, it takes this argument and ignores input. A
numeric vector of ott ids obtained with |
ott_rank |
A character vector with the ranks you wanna get lineage children from. |
A list of named numeric vectors with OTT ids from input and all requested ranks.
Get the Open Tree of Life Taxonomic identifier (OTT id) and name of all lineages from one or more input taxa.
get_ott_lineage(input = NULL, ott_ids = NULL)
get_ott_lineage(input = NULL, ott_ids = NULL)
input |
Optional. A character vector of names. |
ott_ids |
If not NULL, it takes this argument and ignores input. A
numeric vector of ott ids obtained with |
A list of named numeric vectors of ott ids from input and all the clades it belongs to.
taxa <- c("Homo", "Bacillus anthracis", "Apis", "Salvia") # lin <- get_ott_lineage(taxa) # Look up an unknown OTT id: get_ott_lineage(ott_id = 454749) # end donttest
taxa <- c("Homo", "Bacillus anthracis", "Apis", "Salvia") # lin <- get_ott_lineage(taxa) # Look up an unknown OTT id: get_ott_lineage(ott_id = 454749) # end donttest
Extract valid children from given taxonomic name(s) or Open Tree of Life Taxonomic identifiers (OTT ids) from a taxonomic source.
get_valid_children(input = NULL, ott_ids = NULL, taxonomic_source = "ncbi")
get_valid_children(input = NULL, ott_ids = NULL, taxonomic_source = "ncbi")
input |
Optional. A character vector of names. |
ott_ids |
If not NULL, it takes this argument and ignores input. A
numeric vector of ott ids obtained with |
taxonomic_source |
A character vector with the desired taxonomic sources. Options are "ncbi", "gbif" or "irmng". Any other value will retrieve data from all taxonomic sources. The function defaults to "ncbi". |
GBIF and other taxonomies contain deprecated taxa that are not marked as such in the Open Tree of Life Taxonomy. We are relying mainly in the NCBI taxonomy for now.
A named list containing valid taxonomic children of given taxonomic name(s).
# genus Dictyophyllidites with ott id = 6003921 has only extinct children # in cases like this the same name will be returned tti <- rotl::taxonomy_taxon_info(6003921, include_children = TRUE) gvc <- get_valid_children(ott_ids = 6003921) # More examples: get_valid_children(ott_ids = 769681) # Psilotopsida get_valid_children(ott_ids = 56601) # Marchantiophyta
# genus Dictyophyllidites with ott id = 6003921 has only extinct children # in cases like this the same name will be returned tti <- rotl::taxonomy_taxon_info(6003921, include_children = TRUE) gvc <- get_valid_children(ott_ids = 6003921) # More examples: get_valid_children(ott_ids = 769681) # Psilotopsida get_valid_children(ott_ids = 56601) # Marchantiophyta
Check if a tree is a valid chronogram.
is_good_chronogram(phy)
is_good_chronogram(phy)
phy |
A |
TRUE
if it is a valid tree.
phy
is a phylo
object and/or a chronogram.Checks if phy
is a phylo
object and/or a chronogram.
is_phylo(phy = NULL, brlen = FALSE, dated = FALSE)
is_phylo(phy = NULL, brlen = FALSE, dated = FALSE)
phy |
A |
brlen |
Boolean. If |
dated |
Boolean. If |
Nothing
Find all authors and where they have deposited their trees
make_all_associations(outputfile = "depositorcache.RData")
make_all_associations(outputfile = "depositorcache.RData")
outputfile |
Path including file name. NULL to prevent saving. |
a data.frame
of "person" and "urls".
Create a cache from Open Tree of Life
make_contributor_cache(outputfile = "contributorcache.RData")
make_contributor_cache(outputfile = "contributorcache.RData")
outputfile |
Path including file name |
List containing author and curator results
Associate Open Tree of Life authors with studies
make_otol_associations()
make_otol_associations()
data.frame
with author last name, author first and other names, and comma delimited URLs for Open Tree of Life studies
Create an overlap table
make_overlap_table(results_table)
make_overlap_table(results_table)
results_table |
An "author.results" or "curator.results" |
A data.frame
with information on curators and what clades they've worked on
Associate TreeBase authors with studies
make_treebase_associations()
make_treebase_associations()
data.frame
with author last name, author first and other names, and comma delimited URLs for TreeBase studies
Create a cache from TreeBase
make_treebase_cache(outputfile = "treebasecache.RData")
make_treebase_cache(outputfile = "treebasecache.RData")
outputfile |
Path including file name |
List containing author and curator results
Add Open Tree of Life Taxonomy to tree nodes.
map_nodes_ott(tree)
map_nodes_ott(tree)
tree |
A tree either as a newick character string or as a |
A phylo
object with "nodelabels".
## Not run: # Load the Open Tree chronograms database cached in datelife: utils::data(opentree_chronograms) # Get the small chronograms (i.e., chronograms with less that ten tips) to generate a pretty plot: small <- opentree_chronograms$trees[unlist(sapply(opentree_chronograms$trees, ape::Ntip)) < 10] # Now, map the Open Tree taxonomy to the nodes of the first tree phy <- map_nodes_ott(tree = small[[1]]) # and plot it: # plot_phylo_all(phy) library(ape) plot(phy) nodelabels(phy$node.label) ## End(Not run) # end dontrun
## Not run: # Load the Open Tree chronograms database cached in datelife: utils::data(opentree_chronograms) # Get the small chronograms (i.e., chronograms with less that ten tips) to generate a pretty plot: small <- opentree_chronograms$trees[unlist(sapply(opentree_chronograms$trees, ape::Ntip)) < 10] # Now, map the Open Tree taxonomy to the nodes of the first tree phy <- map_nodes_ott(tree = small[[1]]) # and plot it: # plot_phylo_all(phy) library(ape) plot(phy) nodelabels(phy$node.label) ## End(Not run) # end dontrun
Now storing >200 chronograms from Open Tree of Life
opentree_chronograms
opentree_chronograms
A list of four elements, containing data from OpenTree of Life chronograms
A list of lists of author names of the original studies that published chronograms in the Open Tree of Life database.
A list of lists of curator names that uploaded chronograms to the Open Tree of Life database.
A list of study identifiers.
A multiPhylo
object storing the chronograms from Open Tree of
Life database.
A character vector indicating the time when the database object was last updated.
A character vector indicating when the chronogram database opentree_chronograms
object was last updated. Format is year.month.day
Generated with
devtools::install_github("ropensci/rotl", ref = devtools::github_pull("137"))
remotes::install_github("ROpenSci/bibtex")
opentree_chronograms <- get_opentree_chronograms()
opentree_chronograms$update_time <- Sys.time()
opentree_chronograms$version <- format(Sys.time(), "%Y.%m.%d")
usethis::use_data(opentree_chronograms, overwrite = T, compress="xz")
and updated with update_datelife_cache()
Check if a tree has branch lengths
phylo_has_brlen(phy)
phylo_has_brlen(phy)
phy |
A |
A TRUE or FALSE
Convert spaces to underscores in trees.
phylo_tiplabel_space_to_underscore(phy)
phylo_tiplabel_space_to_underscore(phy)
phy |
A |
A phylo
object.
Convert underscores to spaces in trees.
phylo_tiplabel_underscore_to_space(phy)
phylo_tiplabel_underscore_to_space(phy)
phy |
A |
A phylo
object.
Problematic chronograms from Open Tree of Life.
problematic_chronograms
problematic_chronograms
A list of trees with unmapped taxa
Before we developed tools to clean and map tip labels for our cached trees we found some trees that were stored with unmapped tip labels we extracted them and saved them to be used for testing functions. Generated with problematic_chronograms <- opentree_chronograms$trees[sapply(sapply(opentree_chronograms$trees, "[", "tip.label"), function(x) any(grepl("not.mapped", x)))] usethis::use_data(problematic_chronograms) opentree_chronograms object from commit https://github.com/phylotastic/datelife/tree/be894448f6fc437241cd0916fab45e84ac3e09c6
[", "tip.label"), function(x) any(grepl("not.mapped", x)))]: R:%22,%20%22tip.label%22),%20function(x)%20any(grepl(%22not.mapped%22,%20x)))
Get an mrcaott tag from an OpenTree induced synthetic tree and get its name and ott id
recover_mrcaott(tag)
recover_mrcaott(tag)
tag |
A character vector with the mrca tag |
A numeric vector with ott id from original taxon named with the corresponding ott name
This uses the Paleobiology Database's API to gather information on the ages for all specimens of a taxon. It will also look for all descendants of the taxon. It fixes name misspellings if possible. It is basically a wrapper for get_fossil_range.
summarize_fossil_range(taxon, recent = FALSE, assume_recent_if_missing = TRUE)
summarize_fossil_range(taxon, recent = FALSE, assume_recent_if_missing = TRUE)
taxon |
The scientific name of the taxon you want the range of occurrences of |
recent |
If TRUE, forces the minimum age to be zero |
assume_recent_if_missing |
If TRUE, any taxon missing from pbdb is assumed to be recent |
a single row data.frame of max_ma and min_ma for the specimens, with rowname equal to taxon input
Taxon name resolution service (tnrs) applied to a vector of names by batches
tnrs_match(input, reference_taxonomy, tip, ...) ## Default S3 method: tnrs_match(input, reference_taxonomy = "otl", ...) ## S3 method for class 'phylo' tnrs_match(input, reference_taxonomy = "otl", tip = NULL, ...)
tnrs_match(input, reference_taxonomy, tip, ...) ## Default S3 method: tnrs_match(input, reference_taxonomy = "otl", ...) ## S3 method for class 'phylo' tnrs_match(input, reference_taxonomy = "otl", tip = NULL, ...)
input |
A character vector of taxon names, or a phylo object with tip names, to be matched to taxonomy. |
reference_taxonomy |
A character vector specifying the reference taxonomy to use for tnrs. |
tip |
A vector of mode numeric or character specifying the tips to match. If left empty all tips will be matched. |
... |
Arguments passed on to
|
There is no limit to the number of names that can be queried and matched.
The output will preserve all elements from original input phylo object and will add
A character vector indicating the state of mapping of phy$tip.labels:
Tnrs matching was not attempted. Original labeling is preserved.
Matching was manually made by a curator in Open Tree of Life.
Tnrs matching was attempted and successful with no approximate matching. Original label is replaced by the matched name.
Tnrs matching was attempted and successful but with approximate matching. Original labeling is preserved.
Tnrs matching was attempted and unsuccessful. Original labeling is preserved.
A character vector preserving all original labels.
A numeric vector with ott id numbers of matched tips. Unmatched and original tips will be NaN.
if tips are duplicated, tnrs will only be run once (avoiding increases in function running time) but the result will be applied to all duplicated tip labels
An object of class data frame or phylo, with the added class match_names.
NULL
NULL
tnrs_match(input = c("Mus")) tnrs_match(input = c("Mus", "Mus musculus")) tnrs_match(input = c("Mus", "Echinus", "Hommo", "Mus"))
tnrs_match(input = c("Mus")) tnrs_match(input = c("Mus", "Mus musculus")) tnrs_match(input = c("Mus", "Echinus", "Hommo", "Mus"))
This uses the taxize package's wrapper of the Global Names Resolver to get taxonomic paths for the vector of taxa you pass in. Sources is a vector of source labels in order (though it works best if everything uses the same taxonomy, so we recommend doing just one source). You can see options by doing taxize::gnr_datasources(). Our default is Catalogue of Life. The output is a phylo object (typically with many singleton nodes if collapse_singles is FALSE: nodes with only one descendant (like "Homo" having "Homo sapiens" as its only descendant) but these singletons typically have node.labels
tree_from_taxonomy( taxa, sources = "Catalogue of Life", collapse_singles = TRUE )
tree_from_taxonomy( taxa, sources = "Catalogue of Life", collapse_singles = TRUE )
taxa |
Vector of taxon names |
sources |
Vector of names of preferred sources; see taxize::gnr_datasources(). Currently supports 100 taxonomic resources, see details. |
collapse_singles |
If true, collapses singleton nodes |
A list containing a phylo object with resolved names and a vector with unresolved names
taxa <- c( "Homo sapiens", "Ursus arctos", "Pan paniscus", "Tyrannosaurus rex", "Ginkgo biloba", "Vulcan", "Klingon" ) results <- tree_from_taxonomy(taxa) print(results$unresolved) # The taxa that do not match ape::plot.phylo(results$phy) # may generate warnings due to problems with singletons ape::plot.phylo(ape::collapse.singles(results$phy), show.node.label = TRUE) # got rid of singles, but this also removes a lot of the node.labels # end donttest
taxa <- c( "Homo sapiens", "Ursus arctos", "Pan paniscus", "Tyrannosaurus rex", "Ginkgo biloba", "Vulcan", "Klingon" ) results <- tree_from_taxonomy(taxa) print(results$unresolved) # The taxa that do not match ape::plot.phylo(results$phy) # may generate warnings due to problems with singletons ape::plot.phylo(ape::collapse.singles(results$phy), show.node.label = TRUE) # got rid of singles, but this also removes a lot of the node.labels # end donttest
This includes opentree chronograms, contributors, treebase and curators For speed, datelife caches chronograms and other information. Running this (within the checked out version of datelife) will refresh these. Then git commit and git push them back
update_all_cached()
update_all_cached()
None
The function calls get_opentree_chronograms()
to update the OpenTree
chronograms database cached in datelife. It has the option to write the updated
object as an .Rdata file, that will be independent of the opentree_chronograms
data object that you can load with data("opentree_chronograms", package = "datelife")
.
update_datelife_cache( write = TRUE, updated_name = "opentree_chronograms_updated", file_path = file.path(tempdir()), ... )
update_datelife_cache( write = TRUE, updated_name = "opentree_chronograms_updated", file_path = file.path(tempdir()), ... )
write |
Defaults to |
updated_name |
Used if |
file_path |
Used if |
... |
Arguments passed on to
|
A list of 4 elements:
A list of lists of author names of the original studies that published chronograms currently stored in the Open Tree of Life database.
A list of lists of curator names that uploaded chronograms to the Open Tree of Life database.
A list of study identifiers from original studies that published chronograms currently stored in the Open Tree of Life database.
A multiPhylo
object storing the chronograms from Open Tree of
Life database.
A character vector indicating the time when the database object was last updated.
A character vector indicating when the chronogram database opentree_chronograms
object was last updated. Format is year.month.day