Retrieve the taxonomic data for a given NCBI taxon ID using a local database or as remote data sources.

annotate_with_NCBI_taxid(taxid, rank_vc = NULL, mode = "remote")

Arguments

taxid

A character or numeric vector containing the target NCBI taxon ID.

rank_vc

A character vector containing the desired taxonomic ranks. If empty, all available taxonomic ranges will be retrieved.

mode

A character vector, if "local" will use a local database instead of remote resources. You will not have to download the database but it is slower.

Value

A DataFrame with columns taxid and taxonomic ranks.

Examples

annotate_with_NCBI_taxid(7955, mode = "remote")
#> No ENTREZ API key provided
#>  Get one via taxize::use_entrez()
#> See https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/
#> # A tibble: 1 × 30
#>   taxid `no rank`   super…¹ clade kingdom clade.1 clade.2 clade.3 phylum subph…²
#>   <chr> <chr>       <chr>   <chr> <chr>   <chr>   <chr>   <chr>   <chr>  <chr>  
#> 1 7955  cellular o… Eukary… Opis… Metazoa Eumeta… Bilate… Deuter… Chord… Crania…
#> # … with 20 more variables: clade.4 <chr>, clade.5 <chr>, clade.6 <chr>,
#> #   clade.7 <chr>, superclass <chr>, class <chr>, subclass <chr>,
#> #   infraclass <chr>, clade.8 <chr>, `no rank.1` <chr>, cohort <chr>,
#> #   subcohort <chr>, clade.9 <chr>, superorder <chr>, order <chr>,
#> #   suborder <chr>, family <chr>, subfamily <chr>, genus <chr>, species <chr>,
#> #   and abbreviated variable names ¹​superkingdom, ²​subphylum