Repository navigation
[FIX] DecoyGenerator: reversed decoys for unspecific cleavage (ProSE, SimpleSearchEngine) - #10686
Conversation
…unspecific cleavage The digest with 'unspecific cleavage' is every subsequence of the protein, not a partition of it, so the pseudo-reversed decoy was the concatenation of all of them (7.9 million residues for a 363-residue protein). ProSE and SimpleSearchEngine generate decoys with reversePeptides() unless the specificity is 'none', so '-Search:enzyme "unspecific cleavage"' with generated decoys failed in the fragment index (more than 65535 residues per protein). There are no enzymatic termini to keep, so the protein is reversed as a whole. An empty protein no longer reads out of bounds. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_016TFAtgwsNjvcQbvJjBwhG1
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Change: Bug fix Merge Risk: ⚪ Minimal · up to
|
…ein for unspecific cleavage (#10694) * [FIX] DecoyGenerator::shuffle/shufflePeptides: shuffle the whole protein for unspecific cleavage Same bug as reversePeptides() (#10686): the digest with 'unspecific cleavage' is every subsequence of the protein, not a partition of it, so the shuffled decoy was the concatenation of all of them (455 residues for a 13-residue protein, millions for a typical protein). There are no enzymatic termini to keep, so the whole protein is now shuffled as one sequence, as with 'no cleavage'. OpenNuXL's decoy loop, which digests before calling shufflePeptides(), gets the same guard. An empty protein no longer crashes shufflePeptides(). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Qb4EiqfmWjGemyt5GPnEyU * Address review: empty protein guard, one OpenNuXL decoy entry per shuffle - shufflePeptides(): return an empty protein before building the shuffle unit, so 'unspecific cleavage' on an empty protein no longer divides by zero in SequenceIdentity_(). - OpenNuXL with 'unspecific cleavage' and NuXL:decoy_factor > 1: each shuffled protein is its own decoy entry (DECOY_<id>, DECOY_<id>_2, ...) instead of being concatenated, which made decoys longer than the target and gave peptides across the junctions. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Qb4EiqfmWjGemyt5GPnEyU --------- Co-authored-by: Claude <[email protected]>
Requested by Timo · project thread
Description
ProSE -Search:enzyme "unspecific cleavage"with generated decoys (-Search:decoys generate, orautoon a target-only database) fails before the search starts:ProSE and SimpleSearchEngine call
DecoyGenerator::reversePeptides(protein, enzyme)unless the specificity isnone. That function digests the protein with the enzyme (no missed cleavages) and pseudo-reverses each peptide. Withunspecific cleavage, the digest is every subsequence of the protein, not a partition of it. The "decoy" was therefore all of those subsequences concatenated: 7.9 million residues for the 363-residue test protein.Fix: in
reversePeptides,unspecific cleavagehas no enzymatic termini to keep, so the whole protein is reversed (reverseProtein), as for a non-specific search. An empty protein no longer readspeptides[-1]out of bounds.no cleavagealready gave the full reverse and is unchanged.Not changed:
shuffle()/shufflePeptides()digest the same way and would build the same oversized decoys withunspecific cleavage. Nothing in ProSE or SimpleSearchEngine calls them with that enzyme, so I left them alone. I can fix them the same way if wanted.Tests:
DecoyGenerator_test:unspecific cleavageandno cleavagegive the reversed protein, and an empty protein gives an empty sequence.TOPP_ProSE_unspecific_decoys(_out): ProSE with unspecific cleavage and generated decoys on the ProSE_1 data. It must report 11 target + 11 decoy proteins and match 3/3 spectra (before this fix it exited with code 6).Testing
Linux release build of develop @ b15249f with this change:
DecoyGenerator_test, allTOPP_ProSE_*from the in-repo data,TOPP_SimpleSearchEngine_*andTOPP_DecoyDatabase_*pass (106 tests).Checklist
Generated by Claude Code
Summary by CodeRabbit
Bug Fixes
Tests