Blog · Data · · 4 min read
Matching scientific trees when one name means three organisms
Ptree displays eleven taxonomic trees side by side (GBIF, Catalogue of Life, ITIS, Open Tree of Life, Encyclopedia of Life, NCBI, World Flora Online, the Paleobiology Database, GTDB, ICTV, and SILVA) and lets you switch trees while staying on the same organism. Joining those trees sounds like a string join on scientific names until you look at how biological nomenclature actually works.
Why scientific names cannot be keys
The international codes for zoology, botany, and prokaryotes govern names independently, so the exact same Latin name legally refers to unrelated organisms in different kingdoms:
- Batis is a coastal flowering plant (Bataceae), an African flycatcher (Platysteiridae), and a moth.
- Cytherea elegans is both a bee fly and an Eocene fossil clam.
- Brachypodella is both a Caribbean land snail and a leaf beetle.
- Homarus is the clawed lobster, while Macropodinae is both the kangaroos and the paradise fishes.
Even inside one kingdom, two sources may file the same species under different accepted genera (such as Senecio transfers in Asteraceae), spell a Latin gender ending differently (Plegiocidaris coronata vs P. coronatus), or disagree on whether an order belongs in one phylum or another.
- all flyingBatis, batisesPlatysteiridae
- Amniote
- AVONET
- BIRDBASE
- COL
- EltonTraits
- EOL
- Hone–O'Gorman
- iNaturalist
- ITIS
- Lavaniegos-Puebla et al.
- NCBI
- Open Tree
- Rotenberry
- TetrapodTraits
- Wikidata
- WoRMS
- xeno-canto
- all stationaryBatis, turtleweedBataceae
- AusTraits
- COL
- EOL
- iNaturalist
- ITIS
- NCBI
- Open Tree
- WCVP
- WFO
- Wikidata
- WoRMS
Building content-hash identity clusters
Ptree separates identity from presentation across two SQLite stores: an identity store holding the final cluster memberships, and an evidence ledger recording every assertion, match, and refusal that produced them. Each cluster is identified by a content hash of its member records rather than an arbitrary auto-incrementing integer.
The crosswalk runs in seven deterministic stages. Direct external identifiers (such as Catalogue of Life and WoRMS IDs carried by GBIF or Wikidata) and shared basionyms carry the highest weight, because a basionym pins two combinations to the same physical type specimen even when taxonomists move the species to a new genus. Scientific-name matching then compares normalized names, authors, and kingdoms, refusing joins where a source's own standing marks a record ambiguous or where pile diagnostics detect an over-merged homonym.
After unioning evidence, phylum and class splitters check whether any cluster spans incompatible higher groups. In the 2026-11-16 build, the class splitter detected 297 mixed clusters (20 of them single-taxon outliers pulled in by a bad upstream identifier) and split them apart. Cross-source lineage disagreement is not an automatic veto, because taxonomists legitimately disagree on higher classification (such as where a microbial order sits in GTDB versus NCBI). Instead, Ptree checks whether two sources' own assertions contradict at the organism level and uses the structural splitters to catch true homonym collisions.
Switching backbones without searching at request time
Not every taxon exists in every tree. If you are looking at a virus phylum in NCBI and switch to SILVA (a ribosomal RNA database with no viruses), or look at an insect family in GBIF and switch to World Flora Online, where should the viewer land?
Walking the tree at request time is too slow: switching a large unrepresented clade into another tree can traverse tens of thousands of nodes and stall for tens of seconds, while bounding the walk to keep it fast changes the answer depending on budget. Instead, the build precomputes every non-exact landing across all 110 ordered pairs of backbones once per generation and stores only rows whose destination differs from their parent's.
The fold walks each source tree leaves-first:
- A node whose cluster has a served member in the destination tree lands on that member directly.
- Any node without an exact counterpart projects from its represented children, giving each represented child equal weight at every fork so a deeply sampled lineage does not drown out smaller relatives.
- Among destination candidates holding at least two-thirds of the subject's weight, the pure candidate with the most weight wins. A destination is pure if its exact counterpart or its reverse projection back into the source tree stays inside the subject. That rule stops GBIF Animalia from landing on Protostomia (which holds two-thirds of phyla by sheer count) when Metazoa holds all of it and nothing else, and stops a single misplaced homonym from dragging a whole phylum sideways.
- Along a unary chain of pure destinations, the subject's rank selects the matching zoom level. Source roots require unanimous agreement so GBIF's Life lands on each destination's root rather than on Eukaryota.
To verify the rule rather than eyeball examples, a holdout benchmark hides the known exact counterpart of every matched node across all 110 backbone pairs and measures whether descendant projection recovers the exact node, a broader ancestor, a narrower descendant, or a sideways miss. Every threshold in the fold was chosen on that holdout measurement. At serving time, /{tree}/{id}/in/{tree2} climbs the source lineage in SQLite (exact counterpart, stored override, or parent) and returns the complete lineage and page offsets synchronously in one response.