Repository navigation
Rescore: FDR within each evidence class (pooled-null p-values, Storey q-values) - #164
Merged
Merged
Conversation
One q-value over every PSM lets a small class pass at a much higher error rate than the canonical one: on one Astral file with UniProt isoforms, variants and chains, isoform-specific PSMs accepted at global 1% carried 4-6% decoys of their own class. After rescoring (Percolator or the native rescorer), every PSM gets the class of its most canonical protein (canonical, else isoform, variant, chain or a combination), target-decoy competition on the rescorer's score runs inside each class with q = (decoys + 1) / targets made monotone, and a target's q-value becomes the larger of its global and class q-value. The filtered TSV, the QPX q-value and quantification therefore accept a PSM only if it passes both. A search with a single class, any FASTA search, is unchanged. The run log prints each class's target and decoy counts.
Target-decoy competition inside a small class cannot reach a low q-value: with q = (decoys + 1) / targets, 85 chain PSMs with no decoy above them still get 1.2%, so every chain and variant PSM of one Astral file was rejected. On that file each small class's decoys scored lower than the canonical ones (two-sample KS, p < 1e-12), so the run's pooled decoys are a conservative null for them. Each target now gets an empirical p-value against every decoy of the run, and Storey q-values (lambda 0.5) are computed within its class. A class whose own decoys land in the pool's top 5% significantly more often than 5% (one-sided z > 2.33), or that has fewer than 20 decoys, keeps target- decoy competition inside the class. The run log prints each class's method and Storey null fraction.
|
ⓘ 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 49 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 |
Merged
2 of 5 tasks
timosachsenberg
added a commit
to OpenMS/OpenMS
that referenced
this pull request
Oct 23, 2026
…lasses (#10636) New ClassFDR (experimental): each target PSM also gets a q-value within its class (by variable modifications or a peptide hit meta value), from pooled-decoy p-values with Storey q-values, guarded by target-decoy competition inside the class when its decoys are few or unusually strong. The PSM q-value becomes the larger of the overall and the class q-value. Off by default. Ported from bigbio/andes#164. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
One global q-value lets small evidence classes through at much higher error rates than the canonical class. On one Astral file searched with UniProt isoforms, variants and chains, PSMs accepted at a global 1% had these error rates within their own class:
What this does
After
--rescore(Percolator) or--rescore-native:canonical, elseisoform,variant,chainor a combination of these.The run log prints each class's target/decoy counts, method and Storey null fraction. A search with a single class, which includes every FASTA search, is unchanged.
Why pooled-null p-values rather than class target-decoy alone
Target-decoy competition inside a small class cannot reach a low q-value. With (D + 1)/T, 85 chain PSMs that have no decoy above them still get q ≈ 1.2%, so every chain and variant PSM of the file was rejected.
On that file, each small class's decoys scored lower than the canonical decoys (two-sample KS, p < 1e-12). The run's pooled decoys are therefore a conservative null for those classes. The guard checks this condition for every class, and on that file it sends the canonical class, whose decoys score higher than the pool, to class target-decoy.
Result on that file (
--rescore, Percolator)The class FDR in brackets is each class's decoys above its lowest accepted score, divided by its accepted targets, measured on the rescorer's decoy output.
Known limit. Most accepted variant PSMs still have a substitution whose mass equals a common modification (D→N, E→Q, D→E…). That error is a real peptide given the wrong explanation, which decoys cannot model, so it is not addressed here.
Testing
--rescore-nativeon the BSA fixture: UniProt XML logs the class step, FASTA does not.cargo clippy --workspace --all-targets -D warnings: clean.cargo test --release --workspacewith CI's skip list: 1,567 passed, 0 failed.