Add offline WURCS-to-SMILES glycan translator and wire it into both pipelines - #10
Draft
m-crown wants to merge 1 commit into
Draft
Conversation
…ipelines Replaces the currently-broken live GlyTouCan glycoct chain (confirmed 0% success, GlyTouCan's API stopped returning glycoct) with an offline glypy -> IUPAC-condensed -> GlyLES route for the cognate-ligand master set (get_ec_information.py), added as a fallback after the existing live chain. For PDB bound-entity glycans (process_all_pdb_contacts.py), where the live chain still works but carries real reliability risk (unthrottled, no retry, HTML-scraped CSDB endpoint), the offline route is used as the primary path instead, falling back to the live chain only on failure. Benchmarked (see docs/iupac_translator_plan.md for full methodology): - cognate-ligand master set: 0% live chain -> 89.1% offline (of glycans with a GlyTouCan ID at all) - PDB-deposited glycans: 96% offline vs. a working-but-fragile live chain Co-Authored-By: Claude Sonnet 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.
Summary
nextflow/bin/wurcs_to_iupac.py: an offline translator from WURCS glycan notation to GlyLES-compatible IUPAC-condensed notation, built onglypy's structured WURCS parse.get_smiles_from_wurcs_offline()toutils.py, wrapping the translator +glylesconversion with a timeout guard (GlyLES is known to hang on malformed input instead of failing fast).get_ec_information.py(cognate-ligand master set, GlyTouCan-sourced): added as a fallback after the existing live glycoct/CSDB chain — that live chain is confirmed dead (0% success, GlyTouCan's API stopped returningglycoct).process_all_pdb_contacts.py(PDB bound-entity glycans): made the primary path, live chain now only runs as fallback — the live chain still works here but carries real reliability risk (unthrottled, no retry, HTML-scraped CSDB endpoint).glypy/glylestonextflow/envs/procoggraph.yaml.Benchmarked against real data (see
docs/iupac_translator_plan.mdfor full methodology): 0% → 89.1% on the real cognate-ligand master set glycans with a GlyTouCan ID; 96% on a real sample of PDB-deposited glycan structures.Stacked on #9 (feature/kegg-bulk-source-priority) — this PR's diff is scoped to just the glycan translation work.
Test plan
nextflow/bin/tests/test_wurcs_to_iupac.py— translator regression tests (13 assertions across known-good structures, furanose-suffix handling, undefined-anomer handling, and confirmed-unsupported substituents)nextflow/bin/tests/test_utils_glycan_offline.py— offline helper + Context B fallback-wiring tests (mocked, no live network calls)nextflow/bin/tests/test_get_ec_information_glycan_fallback.py— Context A backfill-masking logic validated in isolation🤖 Generated with Claude Code