Repository navigation
Fix MOD-species edge loss: match new NCBITaxon: taxon prefix - #14
Merged
Merged
Conversation
The June 2026 GO pipeline migration (geneontology/go-announcements#1153, migrated in #13) reorganized annotation distribution and, on the `-mod` GAF files, changed the Taxon column prefix on MOD-native rows from the legacy lowercase `taxon:` to `NCBITaxon:`. The go_annotation reader's Taxon `in` filter is an exact string match and only enumerated `taxon:<id>` values, so every MOD-native row in the `-mod` files was excluded. The eight MOD-sourced species collapsed to near-zero (only residual ComplexPortal rows, which still use `taxon:`, survived; and PomBase/dictyBase, which have no such rows, dropped to exactly zero). The five `-uniprot` species were unaffected because those files still use `taxon:`. Net effect in the 2026-07-01 release: 3.80M -> 2.02M edges (-47%). Per-species drop (2026-06-01 -> 2026-07-01): mouse 709,827->2,436 rat 571,401->439 zebrafish 196,070->23 fly 170,725->850 yeast 138,996->2,772 worm 103,852->488 pombe 65,983->0 dicty 65,201->0 Enumerate every target taxon under both `taxon:` and `NCBITaxon:` prefixes so single-taxon MOD rows match again while preserving the existing behavior of dropping piped multi-taxon (host/pathogen) annotations. Add a regression test asserting the filter covers both prefixes for all taxa. Verified locally against freshly downloaded YEAST-mod + SCHPO-mod GAFs: 2,772 edges with the old filter vs 218,380 with the fix. Claude-Session: https://claude.ai/code/session_01EEmWQVnmV7nFMca8LfWzYz
Set a whole-graph min_edge_count of 3,000,000 on the go_annotation writer. Healthy full-species builds emit ~3.8M edges; the June 2026 GO format change silently dropped that to ~2.0M and shipped before anyone noticed. This coarse floor sits well above the failure and ~20% below the healthy low, so a catastrophic drop fails the build loudly without tripping on normal fluctuation. Enforcement requires koza with writer count-bound checking (monarch-initiative/koza#238); until that release is picked up the field is a harmless no-op, matching koza's prior behavior. Claude-Session: https://claude.ai/code/session_01EEmWQVnmV7nFMca8LfWzYz
koza 2.6.1 is the first release that enforces writer min/max count bounds (monarch-initiative/koza#238, closing #239); on earlier versions the min_edge_count added to go_annotation.yaml was a silent no-op. Bump the floor and refresh the lockfile so the edge-count-collapse guard actually fails the build. Claude-Session: https://claude.ai/code/session_01EEmWQVnmV7nFMca8LfWzYz
Interleave each taxon id with its two prefixes and trim the comments to what a future reader needs: the Taxon column mixes taxon:/NCBITaxon: prefixes so the list carries both, and min_edge_count is ~20% below current output. Claude-Session: https://claude.ai/code/session_01EEmWQVnmV7nFMca8LfWzYz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The monarch-ingest KG build was failing an edge-count expectation: go-ingest's edge output roughly halved after the June 2026 GO annotation URL migration (#13).
Comparing the two most recent releases confirms the drop:
Root cause
The June 2026 GO pipeline migration didn't just move files under
/annotations/gaf/— on the-modGAF files it also changed the Taxon column prefix on MOD-native rows from the legacy lowercasetaxon:toNCBITaxon:.The reader's
Taxonfilter insrc/go_annotation.yamlusesfilter_code: in, an exact string match, and only listedtaxon:<id>values. So every MOD-native row in the-modfiles was excluded. The eight MOD-sourced species collapsed to near-zero — only residual ComplexPortal rows (stilltaxon:) survived; PomBase and dictyBase, which have no such rows, dropped to exactly zero. The five-uniprotspecies (human, dog, cow, pig, chicken) were unaffected because those files still usetaxon:— human even grew slightly.Per-species edge counts (2026-06-01 → 2026-07-01):
The transform code itself was already robust (
parse_ncbi_taxanormalizes both prefixes); only the pre-filter in the YAML broke.Fix
Enumerate every target taxon under both
taxon:andNCBITaxon:prefixes in the Taxon filter. This restores single-taxon MOD rows while preserving the existing behavior of dropping piped multi-taxon (host/pathogen) annotations. Adds a regression test asserting the filter lists both prefixes for all taxa.Verification
Ran the transform locally against freshly downloaded
YEAST-mod+SCHPO-modGAFs:taxon:only): 2,772 edgesFull test suite passes (18 tests).
https://claude.ai/code/session_01EEmWQVnmV7nFMca8LfWzYz