Skip to main content

Get organism taxonomy (Open Tree of Life Taxonomy)

Description

This function retrieves taxonomic information from the Open Tree of Life (OTT) taxonomy service. It cleans organism names, queries the OTT API, and returns structured taxonomic data including OTT IDs and hierarchical classifications.

Usage

get_organism_taxonomy_ott(
  df,
  url = "https://api.opentreeoflife.org/v3/taxonomy/about",
  retry = TRUE
)

Arguments

df data.frame Data frame containing organism names in a column named "organism"
url character Character string URL of the OTT API endpoint (default: production API, can be changed for testing)
retry logical Logical indicating whether to retry failed queries using only the generic epithet (genus name) when full species names fail (default: TRUE)

Value

Data frame with taxonomic information including OTT IDs, ranks, and taxonomic hierarchy. If the API is unavailable, warns (tima_ott_unavailable_warning) and returns the same columns with no rows.

See Also

Other data-retrieval: get_compounds_xrefs(), get_example_files(), get_file(), get_gnps_tables(), get_last_version_from_zenodo()

Examples

library("tima")

# Single organism
df <- data.frame(organism = "Homo sapiens")
taxonomy <- get_organism_taxonomy_ott(df)

# Multiple organisms
df <- data.frame(organism = c("Homo sapiens", "Arabidopsis thaliana"))
taxonomy <- get_organism_taxonomy_ott(df)