getID: get taxon IDs from taxon names

Description Usage Arguments Examples

View source: R/taxonomy.R

Description

Returns a list or vector of taxon IDs for exact names (in ncbi file names.dmp), use grepName to find IDs from partial names or search patterns. Note that this is an ambiguous mapping, since some names occur multiple times, eg. "Proboscidea" is the name of both a genus of flowering plant and an order containing the elephants, or "Actinobacteria" is a name for both a "class" and a "phylum". If option all is set to TRUE multiple occurences will cause the function to return a named list. If set to FALSE (default), only the first or the last occurences will be reported, depending on option first, and returned as a named vector. TODO: resolve this ambiguity, eg. by checking the rank and taking the taxon ID with the lowest/highest rank.

Usage

1
getID(names, tax, all = TRUE, first = TRUE)

Arguments

names

taxonomy names

tax

NCBI taxonomy object

all

return all matches as a named list, if set to FALSE only the first/last matches (option first) will be reported as a vector

first

return the taxon ID for the first (default: TRUE) or last occurence of the name in NCBI file names.dmp

Examples

1
getID(c("Firmicutes","Cyanobacteria"), tax)

raim/ncbitax documentation built on Aug. 6, 2020, 7:29 a.m.