Repository navigation
[FEATURE] PIP-ECHO shape_features: score how a transfer's peak shape agrees with its precursor's identified features - #10637
timosachsenberg wants to merge 4 commits into
Conversation
…agrees with its precursor's identified features With PipEcho:shape_features true, the transfer FDR model gets three more features per candidate transfer, comparing its peak with the identified features of the same precursor in the other runs (median, leaving out the acceptor's own run): the log ratio of the elution width on the aligned RT scale, the difference in tailing, and the cosine between the observed isotope envelopes. They describe the peak, not its size. A decoy transfer is compared with its donor's precursor. Without a reference the features are 0, 0 and -1. Off by default. ProteomicsLFQ snapshots the width (sigma of the elution model fit, carried onto the aligned scale by the local slope of the run's RT transformation) and the tailing (from the peak's integration boundaries) as feature meta values when the option is on. Ported from bigbio/andes #167 (identity decoys from #172 are not ported). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01F73hZDwadLuUofLxkDHyVS
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 33 minutes. View limit details
✨ Finishing Touches
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 |
…tList() MSVC finds IntList(DataValue) ambiguous (C2440). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01F73hZDwadLuUofLxkDHyVS
clang reads 's' after the quote as a literal suffix and fails to compile. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01F73hZDwadLuUofLxkDHyVS
…heckpoints detected without shape_features PipEcho:* is not part of the checkpoint fingerprint, but the elution width and tailing were only snapshotted at detection with PipEcho:shape_features true. A combine with the option from checkpoints detected without it therefore compared no transfer by width or tailing, without a warning (BSA example: 0 of 11 candidate transfers instead of 11). They are now snapshotted whenever PIP-ECHO is on and dropped at combine time when the option is off, so the output without it stays unchanged. TOPP test: detect without the option into -feat_dir, combine with it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_019EmvqvGCbTQPJEG9k6jJug
…ch HF-X and the frozen entrapment DB Scripts, input/output hashes and result tables of the #10637 benchmark (#10585 recipe; option off vs on, baseline merge-base, transfer q 0.01-0.05, transfer FDP with the frozen shuffled r = 1 entrapment database). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_019EmvqvGCbTQPJEG9k6jJug
|
Benchmark fix pushed:
The snapshots are now taken whenever PIP-ECHO is on and dropped at combine time when the option is off. Output without the option is unchanged: byte-identical mzTab, consensusXML and MSstats on BSA, and identical MSstats on the ProteoBench benchmark. New TOPP test The benchmark results are in the PR description. Generated by Claude Code |
|
Why andes gains +23 % and this port +2.1 % This comes from reading the code and the committed tables; nothing was re-run. It is not a porting bug.
Cheap test, combine-only on the existing
If the ceiling stays near 47k, keep this as a small gain at strict transfer q. The bigger lever would be candidate generation, i.e. extracting every precursor in every run; that is a separate project. Generated by Claude Code |
|
Closing this port. The gain in OpenMS is too small for an extra option.
Benchmark details are in the description and in Generated by Claude Code |
|
Closing without merging; the benchmark in the description is the reason.
The limit is how many candidate transfers PIP-ECHO produces, not how it scores them. That is tracked in #10693, together with what a second attempt at shape features would need. The benchmark scripts and tables remain in Generated by Claude Code |
Requested by Timo · project thread
Description
Before: The transfer FDR model of PIP-ECHO scores a transfer by intensity, mass error, RT agreement, isotope envelope against the theoretical one and ion mobility. A transfer to the wrong peak of the right peptide often looks fine on all of these.
After: With
PipEcho:shape_features true, three more features compare the transfer's peak with the identified features of the same precursor in the other runs (median, leaving out the acceptor's own run): the log ratio of the elution width on the aligned RT scale, the difference in tailing, and the cosine between the observed isotope envelopes. They describe the peak, not its size. A decoy transfer is compared with its donor's precursor; without a reference the features are 0, 0 and −1. Default false.How: Whenever PIP-ECHO is on, ProteomicsLFQ snapshots two feature meta values at detection,
pipecho_widthandpipecho_tailing, so that-feat_dircheckpoints serve both settings. The width is the sigma of the elution fit, scaled by the local slope of the run's RT transformation before the RTs are transformed. The tailing comes from the integration boundaries around the apex. Without the option, both are dropped again at combine time.Impl::annotate_shape_features()fills newScorefields andTransferFDRModeladds them to the SVM predictors. Tests: a class test, and a TOPP test that detects without the option into-feat_dirand combines with it.Andes paired these features with identity decoys (bigbio/andes#172) to estimate the share of false-donor transfers. Those are not ported here because ProteomicsLFQ does not quantify decoy peptides. The donor q gate (#10633) addresses false donors instead.
Benchmark
ProteoBench DDA quant ion module (QExactive HF-X, PXD028735, 3 + 3 runs, 2 h gradients), with the #10585 pipeline. Spectra are ProteoBench's msconvert mzML, as in #10585. Identification per run: Comet 2025.01 → PSMFeatureExtractor → Percolator 3.06 → q ≤ 0.10, PEP as the score. Then
ProteomicsLFQ -targeted_only false -pip_echo true -psmFDR 0.01 -proteinFDR 0.01 -picked_proteinFDR true -protein_inference aggregation, thenConsensusMapNormalizer -algorithm_type rt_localandMSstatsConverter, scored withproteobench0.18.6 (min 3 runs). The scorer reproduces the public quantms submissiond01e87b9…exactly.Arms differ only in
-PipEcho:shape_features(and-PipEcho:fdrfor the operating curve). All arms of one database share the same IDs and the same-feat_dircheckpoints.ce6eb11b; baseline74048ef5(merge-base).DecoyDatabase -method reverse -enzyme Trypsin, sha25663410dbe…). ProteoBench's scorer would countENTRAP_…_HUMANaccessions as human.fb77e3df…; the [FEATURE] ProteomicsLFQ PIP-ECHO: without a protein FDR, transfer only precursors confidently identified somewhere #10633 benchmark uses the same one): HYE, plus one shuffled, mass-matched entrapment protein per target (r = 1), plus reversedDECOY_decoys of both.ENTRAP_(and the peptide occurs in no target protein, I = L). Only transfers on precursors that ProteomicsLFQ reports are counted, with the [FEATURE] ProteomicsLFQ PIP-ECHO: without a protein FDR, transfer only precursors confidently identified somewhere #10633 benchmark's script. FDP = 2·N_E/(N_T + N_E). This counts transfers from false donors, the same error andes' entrapment numbers count. A transfer of the right peptide to the wrong peak is invisible to it.Scripts, hashes and tables:
benchmark-reproduction/andes-ports/pr10637onclaude/andes-benchmarks.Option off = baseline. At transfer q 0.05 and 0.01:
rt_localCSV are byte-identical;The baseline at q 0.05 gives 46,401 precursors, median |eps| 0.2214, E. coli 0.4061, CV 0.2358; with
rt_local0.1572, 0.3359 and 0.0951. #10585 reported 46,375 / 0.2214 / 0.4090 / 0.2356, and 0.157 / 0.338 / 0.095 withrt_local.ProteoBench, plain HYE database (raw /
rt_local):Transfer FDP, entrapment database:
The identified precursors alone have an FDP of 0.47 %. With the option on, the elution width was available for 75 % of the candidate transfers (36,925 of 49,545); tailing and isotope envelope were available for all of them. Combine time does not change.
andes (bigbio/andes#167 and bigbio/andes#172: a public 6-run LFQ DDA benchmark, accession not named; normalised quantity, MBR, min 3 runs):
At matched depth, andes reports bigbio/andes#167 better or equal, e.g. median |eps| −0.0003 to −0.0012.
Verdict
rt_local: median |eps| 0.1519 vs 0.1527, E. coli 0.3166 vs 0.3193, CV 0.0917 vs 0.0918.rt_localmedian |eps| (+0.0006), E. coli (+0.006) and CV (+0.0012) get slightly worse because there are more transfers. andes' changes at the same q go the same way but are ten times larger.-psmFDR 0.01and a picked protein FDR of 0.01 there are few false donors (152 entrapment consensus features), and the features did not favour their transfers. Without the protein filter they do; see the combination with [FEATURE] ProteomicsLFQ PIP-ECHO: without a protein FDR, transfer only precursors confidently identified somewhere #10633 below.Why the gain is smaller in OpenMS:
Combined with #10633 (donor gate). #10633 (merged) turns on
PipEcho:donor_max_q 0.001only with-proteinFDR 1. With-proteinFDR 0.01the gate is off, so the arms above already are the combination. The 2 × 2 therefore runs at-proteinFDR 1:33abd187applied locally (conflicts only where both add code; same build stamp, so the same checkpoints are reused). The patch is in the benchmark folder.Everything else is unchanged.
Transfer FDP, entrapment database,
-proteinFDR 1:ProteoBench, plain HYE database,
-proteinFDR 1(raw /rt_local):-proteinFDR 1), the FDP stays controlled. It is 0.54 % → 0.53 % at q 0.01 and 0.63 % → 0.65 % at q 0.05, while target transfers at q 0.01 rise by 47 % (7,746 → 11,378). This reproduces andes' combination: in quant: identity decoys and a donor gate for the MBR transfer FDR bigbio/andes#172, shape features with the donor gate and identity decoys give 88 entrapment transfers at q 0.01, against 48 before the shape features.rt_localgets worse (0.3397 → 0.3496) and CV goes up by 0.0006. In andes, the combination at q 0.01 gives 62,797 precursors, against 54,932 before the shape features (+14 %).Fix in this benchmark. In
ce6eb11b, ProteomicsLFQ now keeps the shape snapshots in-feat_dircheckpoints that were detected without the option. Before,PipEcho:*was not in the checkpoint fingerprint, so combining withshape_features truefrom such checkpoints silently compared no transfer by width or tailing (BSA: 0 of 11 instead of 11 of 11).Not done:
Suggestion (not in this PR): keep the default
false. The option only helps at strict transfer q (0.01–0.02), by about 1k precursors at equal or slightly better accuracy. Without a protein filter, use it only together with the #10633 gate, which ProteomicsLFQ turns on automatically there.Ported from bigbio/andes#167.
Checklist
How can I get additional information on failed tests during CI
Click to expand
If your PR is failing you can check outIf you click in the column that lists the failed tests you will get detailed error messages.
Advanced commands (admins / reviewer only)
Click to expand
/reformat(experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.Generated by Claude Code