Repository navigation
Metabolite → gene links: metabolite_linked_convergence tier - #73
Merged
Merged
Conversation
…linked_convergence tier) Multi-omics convergence linked layers only by identical feature_id_standardized, so metabolite evidence (standardized to the metabolite name) could never converge with gene-level evidence. Add a second, explicitly weaker kind of convergence: metabolite name -> KEGG compound -> reaction -> KO -> crg GeneID. - src/mappings/metabolite_links.py: per-partition link tables (simulated demo vs real, never merged), currency-metabolite and hub (>25 genes) exclusions kept visible, link confidence never exact / one-to-one. - src/mappings/build_metabolite_links.py + `aree build-metabolite-links`: queries KEGG REST only for curated compounds, caches every response with sha256, resolves GeneIDs against the RS_2024_06 crosswalk and retired-ID sidecar. Output is git-ignored (KEGG redistribution terms). - rank.py: new tier metabolite_linked_convergence between multi_omics_convergence and emerging; linked layers never enter n_supporting_layers or the score; new convergence_basis / linked_* / link_table_* candidate fields. - Evidence cards: "Metabolite-gene links" section with the compound / reaction / KO chain, link confidence, table checksum, stressor caveat and exclusions. - Demo: fabricated ldh (significant) and sdha (not) in the demo crosswalk and GIGAS_HEAT01 chronic table, so GIGAS_GROW06 lactate <-> ldh converges by link and succinate/sdha and ATP do not. - Design note docs/metabolite_gene_links.md, provenance JSON schema, docs, app legend, dashboard KPI, Makefile target, tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
The
multi_omics_convergencetier links layers only by an identicalfeature_id_standardized. Metabolite evidence is standardized to the metabolite name, so it could never converge with RNA-seq, methylation or proteomics evidence. CLAUDE.md requires "a transparent explanation of how molecular layers were linked".What
The design is in
docs/metabolite_gene_links.md. The decisions were confirmed before building: builder only (no KEGG table committed), no change to the score, a new fourth tier, and two demo genes.data/mappings/metabolite_compound_map.tsv) → KEGG reaction → KO →crggene (NCBI GeneID, checked against the RS_2024_06 crosswalk and the retired-ID sidecar). Original identifiers are untouched, and the evidence schema is unchanged.exactorone_to_one_ortholog. Ambiguous names such aslactate(L- and D-lactate) giveinferred. Currency metabolites (ATP, NAD⁺, …;currency_metabolites.yaml) and hub compounds (> 25 genes) are shown on cards but never credited.metabolite_linked_convergence, aftermulti_omics_convergenceand beforeemerging.n_supporting_layersor the score.convergence_basis,linked_layers,linked_features,link_confidences,link_table_status,link_table_sha256.aree build-metabolite-links/make metabolite-links. Every KEGG response is cached with its sha256, and the sidecar validates againstschemas/metabolite_gene_links_provenance.schema.json. The real table is git-ignored because KEGG does not clearly permit redistribution.ldh(significant) andsdha(not significant) genes were added to the demo crosswalk and the GIGAS_HEAT01 chronic table. The results:lactate↔ldh→metabolite_linked_convergence(2 candidates).succinate/sdhaandATPstayemerging.Real-data check (local, not committed)
The first KEGG build gave 191 links. 10,875 of 10,879
crggenes resolve to current GeneIDs; the 4 unresolved are rRNA/tRNA pseudo-IDs. Pyruvate is a hub. Nocrggene carries L-LDH (K00016), so lactate links only through D-lactate. No real candidate is linked yet, because the only real metabolomics study (DUPERRET2025_POMS_STARVE, #70) failed QC.Testing
pytest: 640 passed, both with and without the locally built real table (CI has no table). This includes 27 new tests intests/test_metabolite_links.py, which cover confidence rules, hub and currency exclusion, partition isolation, tier gates, score invariance, cards, and the builder against a fake KEGG including an offline rebuild.ruff check src tests scripts modules/shared: clean.make demo-cleansucceeds.quarto render docs/renders the new page, checked from a copy, because Quarto renders nothing inside the hidden.claude/worktree path.Update: transporter links via KEGG BRITE ko02000
data/mappings/transporter_substrates.tsv: 43 rows, each withsubstrate_basis(ko_definition/substrate_class), the human ortholog it rests on, and a note.get/br:ko02000, rejects any curated KO that isn't in it, records each KO's family path asbrite_family, and lists curated KOs that have nocrggene.inferred. The 25-gene hub cap is applied per link type, so transporter links never remove a compound's enzyme-link credit.crggene. (S)-lactate has no L-LDH enzyme link, but now links through MCT/SMCT transporters (9 genes).pytest: 644 passed, with and without the local table.ruff: clean.🤖 Generated with Claude Code