get_lineage {insect} | R Documentation |
Get full lineage details from a taxonomic ID number.
Description
This function derives the full lineage of a taxon ID number from a given taxonomy database.
Usage
get_lineage(taxIDs, db, simplify = TRUE, numbers = FALSE, cores = 1)
Arguments
taxIDs |
integer or vector of integers giving the taxonomic ID number(s). |
db |
a taxonomy database (a data.frame object).
See |
simplify |
logical indicating whether a single lineage derived from a length-one input should be simplified from a list to a named character vector. Defaults to TRUE. |
numbers |
logical indicating whether the output string(s) should be comprised of the taxonomic ID numbers rather than taxon names. Defaults to FALSE. |
cores |
integer giving the number of processors for multithreading (Defaults to 1).
This argument may alternatively be a 'cluster' object,
in which case it is the user's responsibility to close the socket
connection at the conclusion of the operation,
for example by running |
Value
the full lineage as a named character vector, or list of named character vectors if the length of the input object is > 1 or simplify = FALSE. "names" attributes are taxonomic ranks.
Author(s)
Shaun Wilkinson
References
Federhen S (2012) The NCBI Taxonomy database. Nucleic Acids Research 40, D136-D143. doi:10.1093/nar/gkr1178.
https://www.ncbi.nlm.nih.gov/taxonomy/
Examples
data(whales)
data(whale_taxonomy)
taxIDs <- as.integer(gsub(".+\\|", "", names(whales)[1:2]))
get_lineage(taxIDs, db = whale_taxonomy)