Skip to content

Professor lupin#1038

Open
trishorts wants to merge 17 commits into
smith-chem-wisc:masterfrom
trishorts:professorLupin
Open

Professor lupin#1038
trishorts wants to merge 17 commits into
smith-chem-wisc:masterfrom
trishorts:professorLupin

Conversation

@trishorts

@trishorts trishorts commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces support for circular (head-to-tail cyclized) peptides in the proteomics library by adding a new CircularPeptideWithSetModifications class and making key base class methods virtual to allow for specialized behavior. The main focus is enabling correct mass calculations and fragmentation logic for circular peptides, which differ from linear peptides due to their unique topology.

Key changes include:

Support for Circular Peptides:

  • Added a new class CircularPeptideWithSetModifications in Proteomics.ProteolyticDigestion, representing circular peptides with correct mass and fragmentation logic, including enforcement of no terminal modifications and specialized fragment enumeration.

Extensibility for Specialized Peptide Types:

  • Made the Digest method in Protein virtual, allowing derived classes such as CircularProtein to override digestion behavior for specialized peptide types.
  • Made the MonoisotopicMass property in PeptideWithSetModifications virtual, enabling derived types to adjust mass calculations (e.g., subtracting water for circular peptides).
  • Made the FragmentInternally method in PeptideWithSetModifications virtual, so derived classes can implement topology-specific fragmentation logic.

@codecov

codecov Bot commented Mar 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.52736% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.74%. Comparing base (92be818) to head (c26be97).

Files with missing lines Patch % Lines
mzLib/Proteomics/Protein/CircularProtein.cs 95.55% 7 Missing and 5 partials ⚠️
...icDigestion/CircularPeptideWithSetModifications.cs 92.42% 8 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1038      +/-   ##
==========================================
+ Coverage   81.63%   81.74%   +0.10%     
==========================================
  Files         369      371       +2     
  Lines       47605    48007     +402     
  Branches     5649     5718      +69     
==========================================
+ Hits        38863    39243     +380     
- Misses       7643     7658      +15     
- Partials     1099     1106       +7     
Files with missing lines Coverage Δ
mzLib/Proteomics/Protein/Protein.cs 97.07% <ø> (ø)
...roteolyticDigestion/PeptideWithSetModifications.cs 94.46% <ø> (ø)
...icDigestion/CircularPeptideWithSetModifications.cs 92.42% <92.42%> (ø)
mzLib/Proteomics/Protein/CircularProtein.cs 95.55% <95.55%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2599536d48

ℹ️ 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".

Comment thread mzLib/Proteomics/Protein/CircularProtein.cs Outdated
Comment thread mzLib/Proteomics/Protein/CircularProtein.cs
@nbollis

This comment has been minimized.

trishorts and others added 2 commits June 2, 2026 08:31
Resolve the mzLib.nuspec conflict by taking master's bumped OpenMcdf
(3.1.3) and OpenMcdf.Extensions (2.3.1) versions, matching the merged
Readers.csproj package references. All other files auto-merged cleanly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…oducts

- Proxy digestion: replicate OneBasedPossibleLocalizedModifications onto the
  second copy of the doubled sequence (key k in 1..N-1 also at k+N) so
  wrap-around linear fragments carry their annotated modifications and correct
  masses instead of silently dropping them on the wrapped portion.
- Full-ring enumeration: merge OneBasedPossibleLocalizedModifications alongside
  the supplied variable mods (deduped by position+id), matching the linear
  digestion path so intact-ring forms keep annotated PTM isoforms.
- Full-ring enumeration: cap modified forms at DigestionParams.MaxModificationIsoforms,
  mirroring the linear pathway and avoiding a combinatorial isoform explosion.
- Full-ring enumeration: recompute NumFixedMods from the merged dictionary so a
  variable mod overriding a fixed mod at the same residue no longer overcounts.

Addresses the Critical + two Major findings from the PR smith-chem-wisc#1038 re-review and the
two Codex P1 comments on localized-PTM handling. All 98 circular tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@trishorts

Copy link
Copy Markdown
Contributor Author

@nbollis — heads up, this looks like it's the review for #1036 (the MslProteoformIndex / spectral-library ReadOnlySpan lifetime items, FragmentIntensityModel, agent-residue comments), not #1038 (circular proteins). Flagging in case it was meant for that PR. Collapsing it here to keep this thread focused on the circular-protein changes.

trishorts and others added 2 commits June 2, 2026 10:09
Four tests, each failing on the pre-fix code:
- wrap-around fragment carries an annotated localized mod on its wrapped
  (second-copy) residue;
- intact-ring form includes an annotated localized mod not passed as a
  variable mod;
- full-ring variable-mod forms are bounded by MaxModificationIsoforms;
- NumFixedMods is not overcounted when a variable mod overrides a fixed mod.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add four NUnit tests to CircularPeptideWithSetModifications:
- constructor rejects N-terminal and C-terminal modifications (no free
  termini on a circular peptide);
- FragmentInternally returns identical products on a repeat call (cached
  ring-mass / doubled-prefix arrays);
- FragmentInternally enforces minLengthOfFragments >= 1.

Lifts CircularPeptideWithSetModifications.cs patch coverage 82.9% -> 92.4%;
all four files touched by the PR are now >= 90%.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants