Repository navigation
[FIX] PercolatorInfile: the peptide after an initial Met counts as protein N-terminal in enzN - #10730
Conversation
…otein N-terminal in enzN Since #10717 a protein terminus ('[') counts as a cleavage site in enzN/enzC. In a fully specific search the only PSMs left with enzN = 0 are then the N-terminal peptides after initial-Met clipping (flank 'M', start 1). Target proteins nearly all start with M, reversed decoy proteins rarely do, so enzN = 0 became a near target-only label: Percolator learns it and accepts Met-clipped random matches with no decoys to pay for them (#10726). The peptide after the initial Met is now protein N-terminal for enzN as well, as FragmentIndex (isProteinNTerminal_) and PeptideIndexer (allow_nterm_protein_cleavage) already treat it. The Peptide column keeps the M. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Adjust N-terminal site and verify feature values src/openms/source/FORMAT/PercolatorInfile.cpp, src/tests/class_tests/openms/source/PercolatorInfile_test.cpp |
For evidence starting at position 1 with a preceding methionine, the custom digestion and built-in enzyme paths use an adjusted N-terminal site for enzN. The custom path also uses it for internal-cleavage context. Tests cover clipped and internal methionine cases and confirm that peptide metadata retains the methionine flank. |
Possibly related PRs
- OpenMS/OpenMS#10717: This PR also changes how protein-terminal sites affect Percolator enzyme features.
- OpenMS/OpenMS#10713: This PR changes the custom digestion and built-in enzyme paths used by this feature.
- OpenMS/OpenMS#10714: This PR changes the Percolator feature-stamping behavior used by in-process rescoring.
Priority:
Change: Bug fix · Severity of issue fixed: Medium
Merge Risk: 
Minimal · up to ef608
-
No actionable merge-blocking risk was established for the intended N-terminal enzyme-feature change.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Linked Issues check
-
Explanation
Directly linked issue
#10726requests that a peptide after initiator-Met removal (aa_before 'M', evidence start 1) count as protein N-terminal for enzN. The diff in PercolatorInfile::stampPinFeaturesOnHits adds n_site = '-' when aa_before == 'M' and getStart() == 1. n_site replaces aa_before in both the ProteaseDB branch (enzN via isValidProduct and the 'X'+n_site context) and the isEnz_ branch. The Peptide column still uses aa_before, so it keeps 'M'. This matches the fix proposed in#10726. The issue's suggested test covers a Met-clipped target peptide and an unclipped protein-N-terminal peptide, both with enzN = 1. PercolatorInfile_test adds these checks for Trypsin/P (Percolator rule) and Lys-C/P (ProteaseDB rule), a negative case with M at start 2 (enzN = 0), and a check that the Peptide column reads M.PEPKTIDER.S. The test uses a reversed-decoy-style fixture only indirectly (by start position and flank), not as a full target/decoy protein pair. Benchmark figures in the issue and PR were not re-run here. Tests were not run in this review; the PR states CI runs them.
Full details: Out of Scope Changes check
-
Explanation
The whole-PR diff touches only src/openms/source/FORMAT/PercolatorInfile.cpp and src/tests/class_tests/openms/source/PercolatorInfile_test.cpp. The source change is limited to the enzN site computation in stampPinFeaturesOnHits, which is the scope of
#10726. The local variable first_evidence and the aa_before/aa_after handling only restructure that same computation. The test changes add a start parameter to the stamp helper, a stamp_hit helper that returns the hit, and new assertions for the new rule and its negative case. These support the objective and do not change unrelated behavior. The PR description states that no reference files changed, and the diff confirms no fixture or reference file changes in the reviewed range. The alternatives in#10726(leaving enzN/enzC out of training, pseudo-reversed decoys) are not implemented, which is correct because the issue does not request them.
-
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks the peptide’s start,
And marks the clipped site with care.
The methionine stays in the text,
While enzyme features use the right site.
Then off hops the rabbit, pleased.
Comment @coderabbitai help to get the list of available commands.
Fixes #10726. Follow-up to #10717.
Problem
Since #10717 a protein terminus (
[) counts as a cleavage site inenzN/enzC. In a fully specific search, the only PSMs left withenzN = 0are then the N-terminal peptides after initial-Met clipping (flankM, evidence start 1). Target proteins nearly all start with M, reversed decoy proteins rarely do, soenzN = 0became a near target-only label: Percolator learns it and accepts Met-clipped random matches with no decoys to pay for them (entrapment FDP up to 23.7 % at q = 0.01 in the benchmarks of #10726).Change
PercolatorInfile::stampPinFeaturesOnHits: when the first evidence has the flankMat start 1, the peptide is protein N-terminal forenzN, by theisEnz_rules and by the ProteaseDB rule.FragmentIndex::isProteinNTerminal_and PeptideIndexer (allow_nterm_protein_cleavage) already treat this peptide as protein N-terminal. The Peptide column keeps theM.This is the fix proposed in #10726; in the benchmarks there it brought the entrapment FDP back to the level before #10717, in-process and with the percolator executable on the
.pin.Tests
PercolatorInfile_test: a Met-clipped peptide (M, start 1) and an unclipped protein-N-terminal peptide ([, start 0) both getenzN = 1, with Trypsin/P (Percolator rule) and Lys-C/P (ProteaseDB rule); anMat start 2 still givesenzN = 0; the Peptide column keepsM..No reference file changes: the PercolatorAdapter and Comet fixtures of the TOPP and parity tests have no hit whose first evidence is
Mat start 1, and the ProSE.pintests compare runs with each other.Not built locally; CI runs the tests.
🤖 Generated with Claude Code
Summary by CodeRabbit