Add multi-term ProForma parsing/writing (chimeric +, charge /z, multi-chain //)#118
Merged
trishorts merged 2 commits intoJun 30, 2026
Conversation
Adds support for ProForma 2.0 constructs above a single term: chimeric peptidoforms (+, section 7.2), charge states (/z[adducts], section 7.1), and inter-chain crosslink / branch chains (//, sections 4.2.3.2 and 4.2.4). The string is split on the top-level +, /, and // operators (respecting bracket nesting) and each chain is parsed and written by the existing single-term ProFormaParser/ProFormaWriter; single-term behavior is unchanged. New types: ProFormaPeptidoform (chains plus optional charge/adducts) and ProFormaProteoformGroup (chimeric peptidoforms). New entry points: ProFormaParser.ParseProteoformGroupString and a ProFormaWriter.WriteString overload. 16 tests including canonical round-trips of the specification examples; full suite green (249 passed). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JNnpzBNwfnTbZxtZdtAzLG
rfellers
approved these changes
Jun 30, 2026
rfellers
left a comment
Member
There was a problem hiding this comment.
I like the approach of keeping things separate. One could argue that together is better, but it all comes down to what someone considers a ProForma 'term'. From a practical standpoint, we already have code using the existing API and a breaking change doesn't seem worth it.
trishorts
pushed a commit
to trishorts/sdk
that referenced
this pull request
Jun 30, 2026
The Build and Test job failed on all open PRs (topdownproteomics#116, topdownproteomics#117, topdownproteomics#118) because the final Codecov step errored on upload (exit 4294967295) while fail_ci_if_error was true, marking the whole job failed even though restore, build, and tests all passed (235 passed, 0 failed). - fail_ci_if_error: true -> false so a Codecov-side hiccup no longer fails the build - fix coverage file path: coverage.net6.0.xml -> coverage.xml to match the Coverlet output (/p:CoverletOutput='../../coverage.xml') - bump checkout/setup-dotnet/codecov-action v3 -> v4 to clear the Node 20 deprecation warnings Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #118 +/- ##
==========================================
+ Coverage 89.23% 89.37% +0.14%
==========================================
Files 103 105 +2
Lines 5721 5838 +117
Branches 882 908 +26
==========================================
+ Hits 5105 5218 +113
- Misses 429 431 +2
- Partials 187 189 +2
🚀 New features to boost your workflow:
|
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
Adds first-class support for the ProForma 2.0 constructs that live above a single proteoform term, which
ParseString(single-term) rejects today:+(section 7.2)/z,/z[adducts](section 7.1)//(sections 4.2.3.2, 4.2.4)The approach is intentionally thin and additive: the string is split on the top-level
+,/, and//operators (respecting bracket nesting), and each chain is parsed and written by the existing single-termProFormaParser/ProFormaWriter. Single-term behavior is untouched.API added
ProFormaPeptidoform— one peptidoform:IList<ProFormaTerm> Chains(joined by//),int? Charge,string? IonAdducts.ProFormaProteoformGroup—IList<ProFormaPeptidoform> Peptidoforms(chimeric, joined by+).ProFormaParser.ParseProteoformGroupString(string)and aProFormaWriter.WriteString(ProFormaProteoformGroup)overload.🟨 API shape is open to your preference
This is a feature proposal — the naming and placement are yours to shape. Reasonable alternatives include folding charge onto
ProFormaTerm, or exposing these as a separateProFormaMultiTermParser. Happy to adjust to whatever fits the SDK's direction; the parsing/writing logic is the same regardless.Tests
RoundTripIsCanonicallyIdempotentover the section 4.2.3.2 / 4.2.4 / 7.1 / 7.2 specification examples.🤖 Generated with Claude Code
https://claude.ai/code/session_01JNnpzBNwfnTbZxtZdtAzLG