Repository navigation
quant: identity decoys and a donor gate for the MBR transfer FDR - #172
Merged
Merged
Conversation
Decoy precursors that pass the library entry gate and donor rules with their decoy PSMs become identity-decoy entries. They are aligned without moving the run maps, extracted like targets and, in finalize, scored by the transfer models; their accepted transfers estimate the transfers of false donor identifications, which the mass- and RT-shift decoys cannot model. Identity-decoy rows are never reported. The transfer model also takes the best donor PSM's score, q-value and PEP, and an optional donor PSM q-value for transfer. library.parquet goes to schema 4.
…PSM q-value gate The A/B kept identity decoys as training negatives with the combined estimate, and a best-donor PSM q-value of 0.001 for transfer; donor PSM score, q and PEP as features did not change the result and are dropped.
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
|
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 32 minutes. View limit details
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 |
This was referenced Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The flaw
#167 added peak-shape agreement with the donor run's identified fits as transfer features. A wrong donor identification usually sits on a real MS1 feature (another analyte's peak) that recurs in every run with the same width, tailing and isotope heights. Its transfers therefore look perfect.
The transfer decoys (mass shift, RT shift) only model "right peptide, wrong peak". So the transfer q-value cannot see false donors.
Measured on a public LFQ benchmark (6 runs, HYE plus a 1:1 shuffled entrapment, ALL rule, entrapment factor 1.91), on the same stage 1, transfer q 0.01:
Design
identity_decoy, measured exactly like targets: identified rows in their donor runs, transfers elsewhere.Alignment::add_observations), so they never move a run map.mbr.tsvor the feature parquet.(D + 1) / (K · T) + D_id / T. The first term is the wrong-peak estimate as before;D_idis the identity-decoy transfers at or above the threshold.below_thresholdwithout a q-value.Other changes:
library.parquetgoes to schema 4 (identity_decoy,donor_score,donor_psm_q,donor_psm_pep).donor_gated.Calibration. The identity-decoy estimate of the false-donor share of accepted transfers matches the entrapment:
Without the donor gate it is 0.49 % vs 0.43 % at 0.01, and 1.52 % vs 1.61 % at 0.05.
A/B
Quant-only, same stage 1. In the precursor columns each cell is precursors (min 3) / median |eps| / E. coli |eps| / CV, normalised.
Base stage 1. Entrapment rows come from the entrapment search; the other columns come from a public LFQ benchmark scored on the non-entrapment search. "Matched depth" is the operating curve at 63.7k precursors (min 3).
Rescoring + chimeric stage 1:
Entrapment-only precursors at min 3, q 0.01:
Precursors at min 1 do not change. At min 6, q 0.01 (base): 39,507 with this PR, 44,076 on main, 27,430 before #167.
Decoy acceptance per family at q 0.01 (base, this PR): mass shift 0.34 %, RT shift 0.34 %, identity 30.5 %. Identity decoys are accepted at 52–71 % at q 0.05 without the gate, which is the blind spot itself.
Trade-off.
Sanity checks.
mbr.tsvexactly.mbr.tsvand validation byte for byte as that A/B arm.Operating point
The transfer q-value now counts false donors too, so it is closer to an honest total error. Recommendation: change the
--mbr-fdrdefault from 0.05 to 0.01 (not done here; one variable per PR).--mbr-fdrSo 0.05 adds 5.2k precursors at a large accuracy cost, and is worse than the old 0.05 at the same depth.
Tests
mbr.tsv, the features or the identified rows.add_observationsleaves the fit unchanged;Gate with the pinned 1.87 toolchain:
-D warnings: clean;cargo test --release --workspacewith the CI skips: 1,588 passed, 0 failed;