Skip to contents

Rebuild the NCBI Taxonomy snapshot

Usage

build_ncbi(
  version = format(Sys.Date(), "%Y"),
  archive = NULL,
  dir = build_dir(),
  db = td_connect()
)

Arguments

version

snapshot version to write, e.g. "2026"

archive

path to the NCBI taxdump.tar.gz; downloaded if missing

dir

directory for build inputs and outputs

db

a duckdb connection

Value

the paths written, invisibly

Details

NCBI distributes nodes.dmp (the hierarchy) and names.dmp (every name), in a format that claims to be tab-separated but delimits fields with \\t|\\t.

Every row of names.dmp carries the tax_id of the accepted taxon, whatever the name's class: NCBI mints no separate identifier for a synonym. So the scientific name rows become the accepted names, carrying a taxonID and pointing acceptedNameUsageID at themselves, and every other name class becomes a row for the same taxon with a NULL taxonID – which the taxadb rules permit, since there is no identifier to give.

Examples

if (FALSE) { # \dontrun{
build_ncbi("2026")
} # }