Skip to content

Translation between taxonomies

translate takes a node of one taxonomy and answers with a node of another one. GTDB and NCBI do not map one to one (different species, different ranks, different names), so the answer is a vote, not a lookup.

Only one conversion has been measured: GTDB 232 → NCBI 2026-11, for bacteria and archaea. The method is general, but the defaults and the numbers on this page are for that conversion. Other pairs are planned and nothing is claimed for them. The benchmark scripts and every result file are in benchmarks/; each number on this page comes from a file in benchmarks/results/, which also records the input files (name, URL, size, date, sha256) in provenance.json.

import omnitax

# omnitax build -o taxonomies.sqlite gtdb:232 ncbi+gtdb:232
gtdb = omnitax.open("taxonomies.sqlite", "gtdb:232")
ncbi = omnitax.open("taxonomies.sqlite", "ncbi")

p = gtdb.translate("g__Arenimonas", ncbi, details=True)
p.taxon, p.support, p.total, p.abstained     # Arenimonas (genus), 57.0, 58.0, 25.0 (rounded; benchmarks/results/clades.md)

For GTDB → NCBI the bare call is the measured configuration: the ladder of ranks and the exclusion of NCBI's uninformative nodes that the benchmark used are defaults (see Defaults). Nothing has to be passed.

The method

  1. Shared keys. Both taxonomies must hold the same keys. Today these are genome accessions: NCBI's assembly summaries give the taxid of each genome, GTDB's files name the genomes of each species. (Sequence accessions and ids of another taxonomy work the same way, but no loader fills them yet; see links.)
  2. One vote per source leaf. Take the node in the source taxonomy. Every leaf below it (a GTDB species) votes once, and its vote is split among its genomes. A species with 30,000 genomes therefore does not outvote the rest of its genus. Each genome's vote goes to the node it has in the target taxonomy. weight="genome" lets every genome vote 1 instead.
  3. Votes move up. NCBI files many genomes under placeholders such as "Xanthomonadaceae bacterium" or "Escherichia sp. 4" (specified_species is false). These say nothing below their family or genus, so their vote is moved to their nearest formal ancestor. With ranks= (the default for GTDB → NCBI) every vote, informal or not, goes to its nearest ancestor of one of those ranks: the "unclassified X" nodes between are no taxa, and a strain votes for its species. A vote with no node of those ranks above it says nothing at all and is not counted anywhere but in Placement.unplaced. (Only with abstention; plain voting leaves the votes where they are and lifts the answer.)
  4. Votes above a candidate abstain. To judge a candidate node, the votes that ended at its proper ancestors are left out of its total. They do not count for it and they do not count against it. Votes in other branches still count against. Without this, ten placeholder genomes at the family would stop the genus from ever reaching the threshold.
  5. The guard. What is left after abstention must be at least min_informative (0.2) of all the weight. Otherwise one informative genome among 99 placeholders could name the genus alone.
  6. The threshold. The answer is the deepest node that strictly more than threshold (0.9) of the remaining weight has as ancestor-or-self. Ties go to the deeper node, then the heavier, then the smaller id.

Two more options:

  • top=P replaces steps 3 to 6. It is multitax's rule: keep the most common nodes until they cover P of the weight and take their lowest common ancestor. It has no abstention.
  • cap=True never answers finer than the source node (compared on GTDB_RANKS, or a ladder you give). multitax's own translation is weight="genome", cap=True, top=....

Defaults

What you do not give is taken from a table by (source kind, target kind):

conversion threshold min_informative ranks exclude
GTDB → NCBI (the measured pair) 0.9 0.2 GTDB_RANKS ncbi.uninformative
every other conversion (NCBI → GTDB, GTDB release → release, ...) 0.9 off: plain voting none nothing
consensus 0.9 off: plain voting none nothing

Only the first row was measured; the others are the plain rule, with no abstention, no ladder and no exclusion, because nothing is known to be better. To turn a default off give min_informative=False, ranks=() or exclude=(). top= replaces the threshold and has no abstention, so top= with a min_informative other than False is a ValueError (the ladder and the exclusion still apply).

gtdb.defaults_for(ncbi)       # Defaults(threshold=0.9, min_informative=0.2, ranks=GTDB_RANKS, exclude_uninformative=True)
ncbi.defaults_for(gtdb)       # Defaults(threshold=0.9, min_informative=False, ranks=None, exclude_uninformative=False)

0.9 is for naming (a wrong answer is worse than a coarse one). For placing a novel genome as deep as is defensible, 0.8 is better: it gives up 1.4 points of genus precision for 9 points of genus recall (below). The ladder is part of the measured configuration because without it the informal species hang under unranked "unclassified X" nodes and abstention has little to act on: the bare translate of g__Arenimonas with ranks=(), exclude=() answers Gammaproteobacteria, with the defaults Arenimonas.

The command line and the benchmark

omnitax translate has the same options and the same defaults as Python. --ranks gtdb (or RANK,..., or none), --exclude uninformative (or ids, or none) and --min-informative SHARE|off override them:

$ omnitax translate --db taxonomies.sqlite -t gtdb:232 --to ncbi g__Arenimonas
$ omnitax translate --db taxonomies.sqlite -t gtdb:232 --to ncbi --ranks none --exclude none --min-informative off g__Arenimonas

How it was tested

Data: NCBI 2026-11 and GTDB 232 (901,341 genome-to-taxid links). 5,916 genomes under NCBI's uninformative subtrees never vote and are never a truth; 895,425 remain. Each taxid is lifted to its nearest ancestor with a standard rank (domain to species).

  • Leave-one-genome-out. Hide one genome and predict its NCBI node from the rest of its GTDB species (then genus, family, ... until a node with a standard rank comes out). Queries: all 222,500 genomes of species with three or fewer genomes, plus 20,000 genomes of larger species, two per species (seed 1). 242,500 in all.
  • Leave-one-species-out. Hide a whole GTDB species and predict from the rest of its genus (then family, ...). This is the case of a new genome that has no species in the reference. 197,907 species; each genome of the species is a truth, and a species weighs 1 in total.

Scoring. The truth is the genome's NCBI node, lifted to its nearest formal ancestor, because an informal species such as "Xanthomonadaceae bacterium" only says its family. A prediction is

  • correct if it is an ancestor-or-self of the truth;
  • consistent deeper if it is a descendant of the truth: a placeholder truth cannot contradict a finer answer, so this is not counted wrong;
  • wrong if it is in another branch.

Precision is (correct + consistent deeper) / predicted, and strict counts correct only. Per rank, recall is right at that rank / truths that have the rank, and precision is right at that rank / predictions that reach it. Yield is the mean rank index (0 domain ... 6 species) when correct, 0 when wrong: precision and resolution in one number. The scripts re-implement the rules on precomputed counters and were checked against Taxonomy.translate: 3,200 whole-clade comparisons and 1,000 comparisons of leave-out queries (100 genomes and 100 species hidden in the library itself, five configurations), 0 mismatches (results/translate_weights.md, last line).

What the lenient score cannot see. A finer answer than a placeholder truth is counted as "consistent deeper" and never as wrong, and abstention is what makes answers finer. So "precision" (not wrong) can hide a loss, and the strict number shows it: leaving a species out at t=0.9 with leaf weights, abstention takes strict precision from 87.06 to 80.01 % and the share of answers deeper than the truth from 8.87 to 15.77 %. Whether those deeper answers are right, the data cannot say, because the truth stops at the placeholder. The per-rank precision and recall below are judged only where the truth has the rank, and precision does not fall while recall rises at every rank from phylum to genus, but they cannot see an answer that is deeper than any truth.

In-sample and held out. The defaults were chosen on these same leave-out runs, so the tables are in-sample. As a check the GTDB phyla were split in two halves of equal size (half A holds Pseudomonadota and Actinomycetota, half B Bacillota and Bacteroidota), and a configuration was picked on one half and judged on the other (results/translate_weights_heldout.md). The result:

  • Abstention against plain voting at the same threshold holds on both halves, in both scenarios: precision is the same or higher and recall is higher at every rank from phylum to genus (leaving a species out, genus recall 37.1 → 61.7 % on half A and 26.4 → 49.9 % on half B).
  • The default does not come out of a fixed rule. Picking the highest yield among the 48 configurations that keep a precision of 95 % picks leaf weights at 0.9 without a guard on half A and genome weights at 0.9 without a guard on half B. Keeping a strict precision of 80 % picks threshold 0.8 with guard 0.5 on both. The guard of 0.2 is between these: it is a judgement about single answers, not a measured optimum. The pick of one half gives on the other half a precision of 94.3 to 95.5 % and a strict precision of 76.2 to 81.9 %, against 95.5 / 80.3 and 96.1 / 79.7 for the default.
  • A clade of the walk can hold genomes of both halves (always at the domain), so this holds out the choice of the configuration, not every genome.

Results

All 48 configurations and the other scenarios are in results/translate_weights.md. Here are six: the old rule (one vote per genome, threshold 0.5, no abstention), leaf weights without abstention, the default, the default with genome weights, and the two lower thresholds. f=0.2 is abstention with the guard 0.2.

Leave-one-species-out (n = 197,907):

config precision % strict % deeper % yield correct genus or finer %
genome t=0.5 off 85.25 50.45 34.80 3.59 48.9
leaf t=0.9 off 95.93 87.06 8.87 2.29 18.3
genome t=0.9 f=0.2 95.38 79.80 15.57 2.83 24.4
leaf t=0.9 f=0.2 (default) 95.78 80.01 15.77 2.85 25.4
leaf t=0.8 f=0.2 94.20 76.10 18.10 3.04 30.1
leaf t=0.7 f=0.2 92.29 72.03 20.26 3.15 33.4

Precision / recall (%) per rank, leave-one-species-out:

config domain phylum class order family genus species
genome t=0.5 off 99.9 / 99.9 95.4 / 92.1 93.5 / 88.0 92.1 / 82.7 90.5 / 76.1 86.9 / 67.8 18.4 / 3.7
leaf t=0.9 off 99.9 / 99.9 97.9 / 84.7 97.1 / 65.1 96.2 / 50.8 95.8 / 42.2 95.0 / 32.7 30.1 / 1.5
genome t=0.9 f=0.2 99.9 / 99.9 97.8 / 86.9 98.0 / 82.0 97.7 / 76.8 97.2 / 68.4 96.4 / 55.4 41.6 / 2.5
leaf t=0.9 f=0.2 (default) 99.9 / 99.9 97.9 / 86.5 98.1 / 82.2 97.8 / 76.5 97.5 / 68.6 97.0 / 56.8 45.4 / 2.3
leaf t=0.8 f=0.2 99.9 / 99.9 97.4 / 89.3 97.6 / 86.0 97.2 / 82.0 96.7 / 75.3 95.6 / 65.8 45.6 / 2.5
leaf t=0.7 f=0.2 99.9 / 99.9 96.8 / 91.0 96.9 / 88.4 96.4 / 85.3 95.7 / 79.2 94.5 / 71.2 49.0 / 3.1

Leave-one-genome-out (n = 242,500):

config precision % strict % deeper % yield correct genus or finer %
genome t=0.5 off 84.78 41.88 42.90 3.93 57.2
leaf t=0.9 off 91.36 65.56 25.80 3.07 37.9
genome t=0.9 f=0.2 94.01 78.61 15.40 3.04 29.8
leaf t=0.9 f=0.2 (default) 94.20 78.74 15.46 3.05 30.5
leaf t=0.8 f=0.2 93.27 76.46 16.82 3.16 33.0
leaf t=0.7 f=0.2 92.07 73.97 18.10 3.23 34.9
config domain phylum class order family genus species
genome t=0.5 off 99.9 / 99.9 95.5 / 92.7 93.2 / 88.1 91.2 / 83.1 89.1 / 77.8 86.6 / 72.5 73.8 / 43.1
leaf t=0.9 off 99.9 / 99.9 97.2 / 87.9 95.3 / 73.7 93.1 / 63.6 91.1 / 57.8 89.4 / 53.4 79.0 / 37.5
genome t=0.9 f=0.2 99.9 / 99.9 97.5 / 89.5 97.7 / 85.1 97.2 / 80.7 96.3 / 74.5 95.7 / 67.7 91.1 / 45.0
leaf t=0.9 f=0.2 (default) 99.9 / 99.9 97.5 / 89.3 97.7 / 85.3 97.3 / 80.7 96.5 / 74.8 96.0 / 68.9 91.4 / 45.1
leaf t=0.8 f=0.2 99.9 / 99.9 97.3 / 91.0 97.4 / 87.6 97.0 / 83.9 96.1 / 78.7 95.4 / 73.4 91.3 / 46.0
leaf t=0.7 f=0.2 99.9 / 99.9 96.8 / 92.2 97.0 / 89.2 96.5 / 86.0 95.6 / 81.2 94.8 / 76.5 90.9 / 47.0

What the tables say (precision is "not wrong"; see above for the strict number):

  • Abstention helps at every rank from phylum to genus, at the same threshold. Leaving a species out at 0.9, genus precision goes from 95.0 to 97.0 % and recall from 32.7 to 56.8 %; family from 95.8 / 42.2 to 97.5 / 68.6. Strict precision goes down (87.06 → 80.01 %) because more answers are finer than a placeholder truth.
  • The guard matters little on average. From guard 0 to 0.2 (leaf weights, thresholds 0.5 to 0.9, leaving a species out) the precision per rank from domain to genus changes by 0.1 point at most and the recall by at most 0.9 points. At the species rank precision changes by up to 1.5 points (at 0.9: 44.5 → 45.4 %). It matters for single answers: fewer answers rest on a handful of informative genomes among many placeholders (the share deeper than the truth falls from 18.89 to 15.77 %).
  • Leaf weights beat genome weights slightly (leaving a species out 0.3 to 1.6 points of precision, leaving a genome out 0.1 to 0.8).
  • Threshold trades precision for depth. 0.8 against 0.9, leaving a species out: genus 95.6 / 65.8 against 97.0 / 56.8. That is why 0.8 is the suggestion for placing and 0.9 the default for naming.
  • The species rank is poor whatever the setting: GTDB and NCBI species differ. Leaving a species out, species precision is 26.7 to 51.7 % over the 48 abstention configurations (45.4 % for the default) and recall under 7 %, which is expected for a species that is new by construction. Even with the species' relatives present, it is right 91 % of the time and found for 45 % of the genomes. For naming, stop at the genus or use formal=True.
  • Excluding NCBI's uninformative nodes changes precision by at most 0.15 points for plain voting (benchmarks/results/consensus.md, last ablation table). It is part of the default for consistency with the benchmark, not because it was found to matter.

multitax's rule

top=P was measured with genome weights, no abstention and no cap (benchmarks/consensus.py, results/consensus.md). Leaving a species out:

rule precision % none % yield genus precision / recall %
genome, threshold 0.9, no abstention 95.64 0.00 2.34 94.7 / 36.7
genome, top=0.9 96.24 1.90 1.66 90.6 / 13.8
genome, top=0.95 96.50 4.13 1.45 88.7 / 10.4

top= drops the rare nodes, then often finds a mixed clade whose lowest common ancestor is the root, and falls back to a higher clade or to no answer (2 to 6 % "none" over top= 0.9 to 0.99). At matched precision, the threshold rule resolved deeper: threshold=0.95 (96.28 %, yield 1.99) against top=0.9 (96.24 %, yield 1.66), and threshold=0.99 (96.75 %, yield 1.47) against top=0.95 (96.50 %, 1.45). This measures the rule inside omnitax, with omnitax's scoring and omnitax's order for ties between equal weights (heavier, deeper, smaller id). It is not a run of multitax itself.

An example: GlobDB

sylphd places each GlobDB genome that GTDB does not know by walking its GTDB lineage from the species upwards and taking the first clade that translates to an NCBI node (gtdb.translate(clade, ncbi, ...)). There are 146,310 such genomes (the keys of taxonomy_nearest in sylphd's GlobDB r232 metadata database; its sha256 and date are in benchmarks/results/globdb.md, and the list is not committed). There is no ground truth here, so this is a check of how the answers are distributed, not of accuracy. Rank of the answer, in genomes (benchmarks/nearest_walk.py, results/globdb.md):

setting domain phylum class order family genus species of these, informal species
old: threshold 0.5, genome weights 8,435 9,998 17,119 22,718 22,055 21,958 44,027 40,537
leaf, threshold 0.9, no abstention 26,763 38,926 37,539 16,490 11,334 9,771 5,487 5,238
abstention 0.9, guard 0.2 (default) 23,280 17,967 23,751 26,274 27,324 26,688 1,026 0
abstention 0.8, guard 0.2 17,725 16,773 18,501 27,668 29,780 34,710 1,153 0

(The other settings, guards 0 and 0.5 and thresholds 0.7 and 0.5, are in the result file.) The old rule gave 110,758 answers at order or finer, 40,537 of them informal species. Counting placeholders against every lower rank (leaf weights, no abstention) goes the other way: only 43,082 answers reach order or finer, and 103,228 stop at class or above. With abstention (0.9) 81,312 reach order or finer, and 93,311 with 0.8. Informal species can no longer be an answer, because their votes are lifted. These distributions say how deep the answers are, not whether they are right; the strict numbers above are the caution.

Kingdom. GTDB_RANKS has no kingdom, but NCBI has them for prokaryotes (Bacillati, Pseudomonadati), so the measured configuration cannot answer at kingdom and falls to domain. With a ladder that has a kingdom (ranks=("domain", "kingdom", "phylum", ...)), 9,164 of the 23,280 domain answers of the default become kingdom answers (14,117 stay domain), a row of results/globdb.md. That configuration was not measured against a truth: the leave-out benchmark has seven ranks and was not rerun with a kingdom.

Four GTDB clades from the walk show what abstention does. Counts are leaf weights (one per GTDB species), computed on the full data (results/clades.md); the clade tests in tests/test_real_data.py check the answers on small real subsets.

clade old (0.5, genome) leaf 0.9, no abstention default (0.9, guard 0.2) 0.8, guard 0.2
g__Arenimonas Arenimonas (genus) Gammaproteobacteria (class) Arenimonas (genus) Arenimonas (genus)
g__Ruminococcoides Ruminococcus (genus) Clostridia (class) Ruminococcus (genus) Ruminococcus (genus)
o__Aenigmatarchaeales Candidatus Aenigmatarchaeota archaeon (species) Archaea (domain) Archaea (domain) Candidatus Aenigmatarchaeota (phylum)
g__Thiolapillus Thiolapillus sp. (species) Gammaproteobacteria (class) Sedimenticolaceae (family) Sedimenticola (genus)
  • Arenimonas. 120 genomes in 83 species. Many are informal species filed under the family. Without abstention they vote against the genus, and 0.9 falls to the class. With it, 57.0 of the 58.0 informative weight is at the genus (25.0 abstained).
  • Ruminococcoides. The same effect with 1,531 genomes in 222 species: 152.8 of 155.2 informative weight is at the genus Ruminococcus (66.8 abstained). NCBI files these genomes mostly under Ruminococcus, so that is the answer, under another name than GTDB's.
  • Aenigmatarchaeales. Not a unanimous phylum. Of 28.5 informative weight (42 species in all), 24.5 (86 %) is in Candidatus Aenigmatarchaeota, 3 in Nanobdellota and 1 in Microcaldota; another 13.5 are placeholders at the domain, which abstain. So 0.9 refuses the phylum, and 0.8 accepts it. The old rule's species answer is an informal species. (At the domain, at the default, the answer rests on all 42 votes: nothing abstains.)
  • Thiolapillus. Of GTDB's 20 species-weights 15 vote for NCBI's Sedimenticola, 2 for NCBI's Thiolapillus, 1 for Chromatiaceae, and 2 are placeholders above the order, which abstain. At 0.9 no genus holds 90 % of the 18 that count, so the answer is the family that holds both, Sedimenticolaceae (17 of 18). At 0.8 Sedimenticola holds 15 of 18 (83 %) and wins. The two taxonomies disagree about this genus, and the vote shows it.

GTDB 214.1 into 232

Seven nodes of GTDB 214.1 translated into 232 (threshold 0.9; the defaults of an unmeasured pair, so plain voting and no ladder; results/clades.md, last table). Only Pseudomonas and Escherichia differ between the four settings:

214.1 node genome weights leaf weights genome weights, cap=True leaf weights, cap=True
g__Pseudomonas Pseudomonas aeruginosa (species) Pseudomonas (genus) Pseudomonas (genus) Pseudomonas (genus)
g__Escherichia Enterobacteriaceae (family) Escherichia (genus) Enterobacteriaceae (family) Escherichia (genus)

Streptomyces, Lactobacillus, Bacillus, Clostridium (genus) and Lachnospiraceae (family) give themselves in all four. Genome weights let a heavily sequenced species of 214.1 outvote the rest of its genus; leaf weights do not, and cap=True only changes Pseudomonas. The cause of the Escherichia family answer (genomes of 214.1's E. coli that are in other species in 232) was not measured here. cap itself has no measurement of precision in the current benchmark: an earlier one was run on a different scoring and is not published.

What was not measured

  • NCBI → GTDB, and GTDB release → release. They use plain voting with no ladder, and nothing is claimed for them. One example of why the 0.9 default may be too high here: an NCBI species can be spread over several GTDB species, and the answer then goes up. NCBI's Escherichia coli (562) translated into GTDB 232 (NCBI 2026-11-26) gives the family Enterobacteriaceae, because GTDB places the genomes of NCBI's E. coli in species of more than one genus; threshold=0.5 gives s__Escherichia coli. You can look at the votes with ncbi.translate("562", gtdb, details=True). This is one case, not a measurement; the figures behind it are not in a committed result.
  • Kingdom. The measured configuration has no kingdom in its ladder and cannot answer at it (see GlobDB above); a ladder with a kingdom was not benchmarked against a truth.
  • cap. The effect of cap=True on precision is not in the current benchmark.
  • Eukaryotes and viruses. GTDB has none; the benchmark is bacteria and archaea only.
  • Any pair with SILVA, Greengenes2 or Open Tree. No loader makes links for them yet.
  • A comparison with a tool other than the multitax rule. In particular ncbi-gtdb_map.py from gtdb_to_taxdump (a 0.90 homogeneity fraction on a random subsample of up to 100 genomes, no abstention) was not run.
  • One NCBI date (2026-11) and one GTDB release (232). The truth is NCBI's taxid for each GTDB genome as GTDB's metadata gives it, a snapshot of the release, so it is not independent of GTDB's own mapping.
  • Accuracy on real queries. GlobDB is a distribution check, as said above. The benchmark says how well a genome that is left out is placed among genomes that are in the reference, not how well an unknown organism is classified. And the choice of the defaults is in-sample, with the held-out check above as the only protection.

Reproduce

# one build for the GTDB/NCBI scripts, one for the release table (omnitax build --help)
omnitax build -o scratch/bench/tax.sqlite gtdb:232 ncbi+gtdb:232 --cache-dir scratch/cache
omnitax build -o scratch/bench/releases.sqlite gtdb:214.1 gtdb:232 --cache-dir scratch/cache

uv run --with numpy python benchmarks/translate_weights.py --taxdump scratch/cache/new_taxdump.tar.gz \
    --gtdb-dir scratch/cache --cache scratch/bench/prepared.pkl --verify 200
uv run --with matplotlib python benchmarks/consensus.py --taxdump scratch/cache/new_taxdump.tar.gz \
    --gtdb-dir scratch/cache --cache scratch/bench/prepared.pkl --verify 300
uv run python benchmarks/clades.py scratch/bench/tax.sqlite --releases scratch/bench/releases.sqlite
uv run python benchmarks/nearest_walk.py ../sylphd/db/meta-globdb-r232-omnitax.sqlite scratch/bench/tax.sqlite

They need the GTDB r232 {ar53,bac120}_{taxonomy,metadata}_r232.tsv.gz files and NCBI's new_taxdump.tar.gz in scratch/cache (NCBI 2026-11-26). The runs recorded in benchmarks/results/ took 555 s (translate_weights.py, 4.4 GB, with --verify 200), 287 s (consensus.py, 5.6 GB, with --verify 300), 1 s (clades.py) and 84 s on 12 processes (nearest_walk.py). See the benchmarks README for the method in full.