feat: add GlyCAM IUPAC parser - #25
Conversation
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull request overview
Adds first-class support for parsing GlyCAM IUPAC glycan strings by normalizing them into IUPAC-condensed notation and then reusing the existing IUPAC-condensed parser, with accompanying documentation and regression tests against the published GlyCAM corpus.
Changes:
- Introduces
parse_glycam_iupac()(plus internal conversion helpers) that converts GlyCAM residue tokens/modifiers and delegates graph construction toparse_iupac_condensed(). - Adds unit tests for simple/branched/modified glycans and corpus-level regression coverage including
NAandon_failuresemantics. - Exports the new API and ships generated Rd docs and an initial (header-only) parse-failures report CSV.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/testthat/test-parse-glycam-iupac.R | Adds focused unit tests plus a chunked corpus regression test ensuring GlyCAM parses and matches IUPAC-condensed references. |
| R/parse-glycam-iupac.R | Implements parse_glycam_iupac() and normalization from GlyCAM IUPAC to IUPAC-condensed prior to parsing. |
| NAMESPACE | Exports parse_glycam_iupac. |
| man/parse_glycam_iupac.Rd | Generated documentation for the new exported function. |
| docs/glycam_iupac_parse_failures.csv | Adds the expected parse-failures report file (currently header-only). |
Files not reviewed (1)
- man/parse_glycam_iupac.Rd: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd45e6add7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Add
parse_glycam_iupac()for GlyCAM IUPAC strings and export it fromglyparse.Details
-OH, and residue modifiers such as[6S]and[9A].-OME; these are normalized to the regular reducing-end form because glyrepr does not represent the terminal moiety separately.[2NAc,6S], and normalize them into IUPAC-condensed modifier suffixes.NAbehavior.NAreference answers indocs/glycan_sequences_iupac_condensed.csv.NEWS.mdentry for the new parser.Verification
Rscript -e 'devtools::document()'docs/glycan_sequences_glycam_iupac.csvanddocs/glycan_sequences_iupac_condensed.csv-> all 15 successful GlyCAM test sequences have exact non-NA IUPAC-condensed referencesDGlcpb1-4DGlcpb1-OME,DGlcp[2NAc,6S]b1-OH, andDGalpNAc[4S,6S]b1-OHair format R/parse-glycam-iupac.R tests/testthat/test-parse-glycam-iupac.RRscript -e 'devtools::test(filter = "parse-glycam-iupac")'-> 7 passed, 0 failed, 0 warnings, 0 skippedRscript -e 'devtools::test()'-> 953 passed, 0 failed, 0 warnings, 0 skipped