Repository navigation
feat: semi-tryptic and non-specific digestion (FragmentIndex / SimpleSearchEngine) - #9112
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdds configurable enzyme specificity (full / semi / none) across digestion, fragment-index building, and FI-based search: new specificity members/params, EnzymaticDigestion handling for semi/none, propagation into FragmentIndex and search algorithms (decoy/indexing), early-exit guards, and tests for all modes. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Params as ParameterSystem
participant FI as FragmentIndex/SearchAlg
participant Dig as EnzymaticDigestion
participant Index as PeptideIndexing/DecoyGen
User->>Params: set peptide:enzyme_specificity (full/semi/none)
Params->>FI: update members -> parse specificity
FI->>Dig: digestor.setSpecificity(specificity)
FI->>Dig: request peptide generation
rect rgba(100,150,200,0.5)
alt SPEC_FULL
Dig->>Dig: full-specific digestion (tokenize & missed cleavages)
Dig->>FI: full-specific peptides
else SPEC_SEMI
Dig->>Dig: full-specific digestion
Dig->>Dig: semiSpecificDigestion_() -> extra peptides
Dig->>FI: full + semi peptides
else SPEC_NONE
Dig->>Dig: generate all substrings in [min,max]
Dig->>FI: all possible peptides
end
end
FI->>Index: pass specificity for indexing/decoys
Index->>User: indexed peptides / decoy DB
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
…leSearchEngine Implements item #1 from #9108. Adds a `peptide:enzyme_specificity` parameter (`full` / `semi` / `none`) to FragmentIndex, PeptideSearchEngineFIAlgorithm, and SimpleSearchEngineAlgorithm — enabling immunopeptidomics-style 8..12mer non-specific search and semi-tryptic search. EnzymaticDigestion::digestUnmodified() previously silently ignored `specificity_`, forcing every caller to use the magic `"unspecific cleavage"` enzyme name for the non-specific path. Both StringView and pair overloads now honor SPEC_NONE (substring enumeration) and SPEC_SEMI (full + semiSpecificDigestion_ variants). Also fixes two pre-existing crashes that the immunopeptidomics workflow exposed: - EnzymaticDigestion::digestUnmodified unsigned underflow when `sequence.size() < min_length` (e.g. signal peptides in HLA proteomes). - FragmentIndex SIGFPE when no peptides survive filtering and bucketsize_ becomes sqrt(0) = 0, dividing by zero in the OMP bucket loop. Replaces hardcoded `SPEC_FULL` literals at four sites (idXML records and the PeptideIndexer re-validation step in both search engines) which would otherwise silently drop semi/non-specific PSMs after the search. New tests in EnzymaticDigestion_test (SPEC_NONE/SEMI/FULL semantics, short / empty sequence guards) and FragmentIndex_test (full/semi/none parameter wiring + tiny-protein crash regression). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…ormat - Decoy generation: use reverseProtein() (plain full reverse) when enzyme_specificity is "none" instead of enzyme-aware reversePeptides(), so decoy search space matches the non-specific target space. Applies to both PeptideSearchEngineFIAlgorithm and SimpleSearchEngineAlgorithm. - EnzymaticDigestion: semiSpecificDigestion_() returns (start, end) pairs (matching ProteaseDigestion convention). Fix the two digestUnmodified() call sites to convert to the format each needs: - StringView overload: substr(start, end - start) instead of substr(start, end) - pair<Size,Size> overload: store (start, end - start) instead of raw (start, end) Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
4caa4bd to
74ac253
Compare
Add missing entries for three features merged after last changelog sync: - PeptideDataBaseSearchFI multi-file search with shared fragment index (#9109) - Semi-tryptic and non-specific digestion in PeptideDataBaseSearchFI and SimpleSearchEngine via new peptide:enzyme_specificity parameter (#9112) - New PSM annotation options (num_matched_peaks, matched_b_ions, matched_y_ions, longest_peptide_ion_sequence, fragment_annotation) in PeptideDataBaseSearchFI and SimpleSearchEngine, with parquet export (#9117) Co-authored-by: Copilot <[email protected]>
Add missing entries for three features merged after last changelog sync: - PeptideDataBaseSearchFI multi-file search with shared fragment index (#9109) - Semi-tryptic and non-specific digestion in PeptideDataBaseSearchFI and SimpleSearchEngine via new peptide:enzyme_specificity parameter (#9112) - New PSM annotation options (num_matched_peaks, matched_b_ions, matched_y_ions, longest_peptide_ion_sequence, fragment_annotation) in PeptideDataBaseSearchFI and SimpleSearchEngine, with parquet export (#9117) Co-authored-by: GitHub Copilot <[email protected]> Co-authored-by: Copilot <[email protected]>
Summary
Implements item #1 from #9108 — semi-tryptic and non-specific (immunopeptidomics) digestion — across
FragmentIndex,PeptideSearchEngineFIAlgorithm, and (per discussion)SimpleSearchEngineAlgorithm.peptide:enzyme_specificity=full(default) /semi/none. Auto-exposed inPeptideDataBaseSearchFIandSimpleSearchEnginevia the existingregisterFullParam_()plumbing.EnzymaticDigestion::digestUnmodified()now honorsspecificity_in both thevector<pair>andvector<StringView>overloads — it previously silently ignored it, forcing callers to use the magic\"unspecific cleavage\"enzyme name for the non-specific path.SPEC_FULLliterals (per engine) replaced: the idXMLenzyme_term_specificityfield and thePeptideIndexingre-validation step. The latter would otherwise silently drop every semi-/non-specific PSM after the search.Bug fixes (uncovered while wiring this in)
EnzymaticDigestion::digestUnmodifiedwhensequence.size() < min_length. Real risk for immunopeptidomics FASTAs containing entries shorter thanmin_length(signal peptides, ORF stubs).FragmentIndex::buildwhen no peptides survive filtering:bucketsize_ = sqrt(0) = 0divides by zero in the OMP bucket loop. Now early-returns with an empty index.Immunopeptidomics workflow
```
PeptideDataBaseSearchFI -in spectra.mzML -database proteome.fasta -out hits.idXML \
-Search:peptide:enzyme_specificity none \
-Search:peptide:min_size 8 -Search:peptide:max_size 12
```
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Tests