get_taxID_spp_counts: Count number of species under each taxonomy ID

Description Usage Arguments Value

View source: R/get_taxID_spp_counts.R

Description

Extract the species count for each taxonomy ID in the _nodes_ structure of the NCBI taxonomy.

Usage

1
2
3
4
5
6
7
8
get_taxID_spp_counts(
  taxonomy_path = NULL,
  nodes = NULL,
  out_file = NULL,
  start_from_species = FALSE,
  what = "spp_counts",
  verbose = TRUE
)

Arguments

taxonomy_path

path to folder containing the NCBI taxonomy files (i.e., the extracted contents of _taxdump.zip_, which can be downloaded from <ftp://ftp.ncbi.nih.gov/pub/taxonomy/> or retrieved using [retrieve_NCBI_taxonomy()]). Ignored if 'nodes' is not 'NULL'.

nodes

data.frame containing the pre-processed information about the NCBI taxonomy structure. This can be generated, e.g., by using [CHNOSZ::getnodes()].

out_file

path to file for saving the output (saved as a tsv file). Ignored if 'NULL'.

start_from_species

logical. If 'TRUE' the counting starts at the 'species' level - i.e., taxon IDs below species (e.g., 'subspecies') receive a count of zero and are not included in the other counts. If 'FALSE', counting starts at the terminal nodes of the taxonomy, regardless of taxonomic level).

what

what to calculate? Accepts '"spp_counts"' for returning the count of species / leaf nodes per taxon ID, or '"ancestry"' for returning the ancestry list.

verbose

logical: regulates function echoing to console.

Value

either a data frame with species counts per taxon ID or a list with the ancestry of each taxonomic ID.


fcampelo/TaxonSampling documentation built on Jan. 14, 2022, 9:42 p.m.