Skip to content

Fold every spelling of a registry the census already counts - #244

Merged
realmarcin merged 7 commits into
mainfrom
fix/census-prefix-spellings
Sep 26, 2026
Merged

realmarcin merged 7 commits into
mainfrom
fix/census-prefix-spellings

Conversation

@realmarcin

@realmarcin realmarcin commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Refs #84 (the spelling half; the inclusion decision stays open there). Closes #255, closes #256, closes #270, closes #271, closes #272, closes #278, closes #279, closes #280, closes #281, closes #282, closes #283, closes #284, closes #285.

The rule

The census counted each registry under one spelling and dropped the rest. prefix_census.norm now folds every namespace named for, or qualified by, a counted registry into that registry (#271). That covers:

  • case and alternate names: gold: and GOLD:; SwissProt:/Swiss: and UniProt:; TAXON: and NCBITaxon:; CAS-RN: and CAS:; TC: and TCDB:; MSH: and MESH:;
  • entity-qualified namespaces: kegg.compound:, mediadive.medium:, gtdb.genome:, uniprot.location:, RHEA-COMP:.

gold.ecosystem and pubchem.compound were always folded this way. Reference and curator collections named for a registry are not its terms and stay out: GO_REF: and PO_REF: are literature-like (#84 lists GO_REF as a CITATION candidate), and GOC: is curator attribution, which #84 proposes never to count. Mechs mix lowercase bioregistry spellings with upper-case ones, TaxonMech most heavily.

The list was measured by scanning every census record at the #120 pins with a token pattern allowing dots, underscores and hyphens. An earlier scan without hyphens missed CAS-RN (#270). A spelling a Mech adopts later won't be caught until someone scans again. Each fold was sampled in the pinned records to confirm it is the same registry.

spellings folds into occurrences
gold GOLD 1,492,983
bacdive BacDive 556,160
gtdb.genome GTDB 135,164
img.taxon IMG 68,303
DSM DSMZ 31,553
pdb.ligand, pdb-ccd, RCSB_PDB, PDBe, pdbe PDB 15,209
RHEA-COMP RHEA 11,169
mediadive.medium / .solution / .ingredient MediaDive 5,347
kegg.compound, kegg.drug, kegg.glycan, kegg.module, KEGG_REACTION, KEGG_PATHWAY KEGG 3,234
pubchem, pubchem.aid, PubChem_Compound PubChem 3,291
komodo.medium KOMODO 3,262
uniprot.location, uniprot.ptm, UniProtKB-KW, SwissProt, swissprot, Swissprot, Swiss, UNIPROT UniProt 1,290
CAS-RN CAS 736
chembl ChEMBL 456
ec EC 214
ChEBI CHEBI 177
PubMed, PUBMED PMID 25
TAXON NCBITaxon 5
MSH, MeSH MESH 15
interpro InterPro 2
TC TCDB 194

About 66 of the CAS-RN values are EC-list numbers that MediaIngredientMech mislabelled as CAS upstream.

Overlaps

build_subsets.py folds the same spellings for heatmap columns, so record lists agree with the counts.

  • Folds that create shared terms: kegg.compound:C00067 is the same term as KEGG:C00067.
  • Separate term keys (TERM_SPACE): Rhea compound ids share values with Rhea reaction ids (966 of 2,243), and PDB ligand codes are a different kind of identifier from entries. Both keep their own term keys, so an overlap never pairs a compound with a reaction or shows a ligand as an entry. They still count toward the RHEA and PDB columns and the edge's vocabulary breakdown. The page's term filter matches them under their column too, so filtering an edge by "PDB:" lists the ligand codes (Edge panel's column filter pre-fills 'PDB:', which hides PDB-CCD ligand terms #284).

Review history: five internal review rounds, then a Codex review, which found MSH: (#285). That is folded here too.

Rerun

prefix_census.py and build_subsets.py were rerun at the #120 pins from the same snapshot, followed by build_data.py and assemble_page.py. Against main:

  • Unchanged: revisions and record counts. The vocabulary tile goes from 46 to 48: ChEMBL and KOMODO had only ever been written the uncounted way.
  • Heatmap:
    • TaxonMech GTDB 648,112 → 783,276;
    • ProteinTraitsMech PDB 235,957 → 250,830, RHEA 613,456 → 624,625, KEGG 245 → 2,018, UniProt +634, CHEBI +172;
    • CellStructureMech UniProt 337 → 993 and PDB 277 → 280;
    • AntibioticMech KEGG 0 → 1,461 and PDB 6 → 339;
    • MediaIngredientMech CAS 727 → 1,463;
    • a few NCBITaxon, InterPro and PMID units in ProteinTraitsMech, and CHEBI +4 in MediaIngredientMech and +1 in CellStructureMech;
    • ProteinTraitsMech TCDB 4,705 → 4,899, in the census only, since TCDB has no column.
    • KEGG moves up the column order, because another Mech now cites it.
  • Clickable cells (records per cell):
    • new: AntibioticMech KEGG, 1,154;
    • AntibioticMech PDB 5 → 331;
    • MediaIngredientMech CAS 287 → 739;
    • CellStructureMech UniProt 65 → 184 and PDB 19 → 20;
    • ProteinTraitsMech KEGG 231 → 1,967, UniProt +595, PDB +456, CHEBI +168, NCBITaxon +2;
    • TaxonMech GTDB +447.
  • Overlap chords: no Mech pair gains or loses an edge. Two pairs gain an "other vocabularies" chord, because their new shared terms are in vocabularies outside the page's short list.
    • ProteinTraitsMech–AntibioticMech gains 140 shared PDB ligand codes.
    • AntibioticMech–MediaIngredientMech gains 21 CAS numbers.
    • Seven more gain one to five terms each.
  • Census date: the note's date moves to 25 September 2026. The census stamps its run date, and that is also the pins' UTC date.
  • Checks: tests pass, and assemble_page.py --check reports current. PrefixListTests now unescapes hyphens and checks that every fold is reachable (PrefixListTests' literal_prefix() leaves escaped hyphens in, so its emitted-names set is wrong #280).

Terms from free text (#254, #272). Overlaps read terms from free text as well as from structured fields, for every prefix, and some of the new terms come from prose:

  • CHEBI:15982 on the CommunityMech–MediaIngredientMech and ProteinTraitsMech–MediaIngredientMech chords comes from a MediaIngredientMech note that rejects that id;
  • the TAXON fold lists ELM:ELME000348 as a Fungi record, though its definition excludes Fungi;
  • the 21 CAS terms come from MediaIngredientMech change-log lines.

This predates the PR, applies to all prefixes, and is filed as #254 for its own methodology change.

Not in this PR

Which namespaces the census should count at all (CATH, CDD, PROSITE, StrainInfo, LPSN, TOGO, UNII and about a hundred more) is the maintainer's decision on #84, with the measured inventory in the latest comment there. _fleet/README.md says so, states the fold rule, and corrects its old claim that adding a census prefix adds a heatmap column.

🤖 Generated with Claude Code

@realmarcin realmarcin changed the title Count every spelling of a registry the census already counts Count the other spellings of registries the census already counts Sep 25, 2026
@realmarcin realmarcin changed the title Count the other spellings of registries the census already counts Fold every spelling of a registry the census already counts Sep 25, 2026
realmarcin and others added 3 commits September 25, 2026 16:24
The census counted GOLD, BacDive, IMG, DSMZ, KEGG, PubChem, MediaDive, KOMODO,
ChEMBL, EC, ChEBI, PDB and PMID under one spelling each and dropped the others.
TaxonMech writes lowercase bioregistry prefixes, so 1,492,983 GOLD, 556,160
BacDive, 68,303 IMG and 31,553 DSMZ identifiers were never counted; so were
kegg.compound/kegg.drug/KEGG_REACTION, pubchem/pubchem.aid, mediadive.*,
komodo.medium, chembl, ec, ChEBI, RCSB_PDB and PubMed/PUBMED elsewhere (#84).
build_subsets.py folds the spellings of heatmap columns the same way, so
AntibioticMech now has a KEGG cell and a kegg.compound term is the same term as
a KEGG one.

Rerun at the #120 pins from the same snapshot: revisions and record counts are
unchanged; only folded prefixes moved. The vocabulary tile goes from 46 to 48
(ChEMBL and KOMODO were only ever written the uncounted way). Which new
namespaces to count stays open on #84.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ured

A scan of every census record at the #120 pins found more spellings of counted
registries: SwissProt/swissprot/Swissprot/UNIPROT, TAXON, PDBe/pdbe, interpro,
KEGG_PATHWAY/kegg.module/kegg.glycan, MeSH and PubChem_Compound (#255). The
census and, for heatmap columns, build_subsets.py now fold them; the comment
and README say the list covers the spellings measured at the pins, not every
spelling there could be. The test comment no longer counts norm's entries
(#256). Rerun at the same pins: ProteinTraitsMech UniProt +17, PDB +10,
NCBITaxon +5, KEGG +5, InterPro +2 and AntibioticMech KEGG +1; four chords gain
one term each; the vocabulary tile stays at 48.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ens allowed

The spelling scan skipped hyphenated prefixes, so CAS-RN and Swiss went
unmeasured (#270), and the census folded entity-qualified namespaces for some
registries but not others (#271). The rule is now written down and applied
evenly: every namespace named for or qualified by a counted registry folds into
it, as gold.ecosystem and pubchem.compound always did. Added: gtdb.genome,
pdb.ligand, pdb-ccd, RHEA-COMP, CAS-RN, uniprot.location, uniprot.ptm,
UniProtKB-KW and Swiss. build_subsets.py keeps Rhea compounds and PDB ligand
codes in their own term space, so an overlap never pairs a compound with a
reaction or a ligand with an entry, while they still count toward their column.

Rerun at the #120 pins: TaxonMech GTDB +135,164, ProteinTraitsMech PDB +14,863,
RHEA +11,169 and UniProt +617, CellStructureMech UniProt 337 to 993,
AntibioticMech PDB 6 to 339, MediaIngredientMech CAS 727 to 1,463; the
vocabulary tile stays at 48.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ed hyphens

TC: is TCDB's own prefix; ProteinTraitsMech cites 194 transporters that way
beside 4,705 TCDB: ones (#278). The rule now names its exception, reference and
curator collections such as GO_REF, and no longer says the lowercase spellings
come from TaxonMech alone; TERM_SPACE gives its real reason for PDB ligand codes
(#279). PrefixListTests unescapes every regex escape, not only dots, and checks
that every norm key is a spelling the census matches (#280).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
GO_REF and PO_REF are literature-like, GO_REF a CITATION candidate in #84; GOC is
curator attribution, which #84 proposes never to count (#282).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…space

The panel pre-fills its filter with the column ("PDB:"), which PDB-CCD ligand
codes and RHEA-COMP compounds never contain, so a refiltered edge could show
"PDB 140" and list none. Terms now also match the column they count toward,
through a TERM_COLUMN map a test holds equal to build_subsets.COLUMN_OF (#284).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
MSH is MeSH's synonym in GO's db-xrefs registry; ten ProteinTraitsMech records
cite MeSH that way, so its MESH count goes from 4 to 14 (#285). Census only:
MESH has no heatmap column.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@realmarcin
realmarcin merged commit fa09a18 into main Sep 26, 2026
1 check passed
@realmarcin
realmarcin deleted the fix/census-prefix-spellings branch September 26, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment