Repository navigation
Conversation
…d:enable)
Spectra of abundant RNAs that the sequence database lacks match decoys or
false targets, often dozens of spectra per molecule, which skews the
target-decoy FDR. With 'background:enable', NASE searches a background of
known RNAs alongside the database ('subset-neighbor search', Lin et al.,
J Proteome Res 2021) and leaves out every spectrum whose best hit is a
background sequence or one of its decoys, before rescoring and FDR.
- Options: 'background:enable', 'background:database' (custom FASTA;
default: built-in human background) and 'background:out' (TSV of the
left-out spectra).
- Built-in human background (share/OpenMS/SEQUENCES/RNA): GtRNAdb hg38
mature tRNAs with 3' ends CCA/CC/C/none, mitochondrial genome (both
strands) and tRNAs, 45S/5S rRNA and 15 abundant small RNAs, with the
script that builds it.
- RNABackgroundDatabase: deterministic per-digestion-product shuffles
(cleavage residues and the 3' residue stay). NASE uses it to make the
background decoys and to reshuffle database decoy oligos that equal a
target or background oligo.
- Background parents never make an oligo a decoy or a background hit and
are removed before FDR, so they do not appear in the results.
- Tests: RNABackgroundDatabase_test; TOPP tests with targets moved into a
custom background, and with the built-in background.
- Docs: TOPP_NASE_Background, including an entrapment check on HAP1 tRNA
data (18 searches): at q <= 5%, native 1020 -> 1570 target spectra
(estimated FDP 3.3% -> 2.1%), Percolator FDP 5.9% -> 3.4%, with
per-oligo shuffled decoys.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 of 3 tasks
Review of #10941: decoys were checked against real oligos only product by product. Products shorter than the minimum length were shuffled without any check, so a missed-cleavage combination of decoy products could equal a target oligo (e.g. targets ACGUAG and CAGAUG with RNase T1, min. length 5 and one missed cleavage: each target's decoy is the other target). RNABackgroundDatabase::rewrite() now handles all sequences together and checks the combinations of up to missed_cleavages + 1 consecutive products of every rewritten sequence. Components of forbidden combinations try further shuffles (a short product may also stay as it is) and keep the one that leaves the fewest forbidden combinations around its occurrences; each product keeps one replacement everywhere, so decoy/target balance is kept. productKeys() lists missed-cleavage combinations too. NASE uses the search's missed cleavages, plus 'variable_max_per_oligo' when modifications can block cleavage. On HAP1 tRNA data (built-in background, min. length 7), this reduces the decoy combinations equal to a real oligo from 1759 to 832 (database decoys) and from 10281 to 6304 (background decoys); the rest consist of products that cannot change (e.g. G, AG). Regression test with the review's case. Co-Authored-By: Claude Opus 5.5 <[email protected]>
2 of 3 tasks
…ound oligos are background The missed-cleavage repair of beacf12 kept a reshuffle if it lowered the number of colliding combinations, so it could trade collisions and create a new one. On HAP1 data it reshuffled the decoy of tRNA-Phe-GAA-4-1 into UAUG + CACG, joined across a 2'-O-methyl G: the mitochondrial oligo UAUGCACG, which then collected up to 65 spectra per run as a decoy. Native results lost a third of their target spectra at q 5% (1570 -> 1028, median of 18 entrapment searches). - RNABackgroundDatabase::rewrite(): a candidate is only taken if the forbidden combinations around the product afterwards are a strict subset of those before (no new collision). - An oligo with a background parent and no database target parent is a background oligo, also if a database decoy shares it (it is a real molecule; subset-neighbor search leaves such matches out). 18 entrapment searches (HAP1, built-in background, min. length 7): native 1519 target spectra at q 5% (estimated FDP 2.4%), Percolator 1848 (3.4%); before the repair 1570 (2.1%) and 1855 (3.4%). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preserve background removal before native reporting and rescoring. Merge parent sets with the existing IdentifiedOligo API before applying the shared database-only target/decoy rule, so training and final FDR agree. Validated with 43 selected CTests and a fresh/cached Percolator comparison. Co-authored-by: OpenAI Codex (GPT-6) <[email protected]>
2 of 3 tasks
Inherit the updated develop base and the MassExplainer header fix. Co-authored-by: OpenAI Codex (GPT-6.2 Sol) <[email protected]>
This branch has not been deployed
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.
Written by an AI agent using GPT-6.2 Sol.
Build follow-up. This branch now includes #10927 at
d45a5c1340, with the upstream ONNX Runtime archive fallback (#10947) and the WindowsMassExplainerheader fix. All 72 selected CTests passed in the ONNX-enabled Linux Debug build, including the NASE, DecoyDatabase, PeptDeep, Compomer, MassExplainer, and FLASH core checks. Windows validation is pending CI.Description
Stacked on #10927 (base:
codex/nase-stack/foundations).Restacked onto #10927 at
d45a5c1340. The merge preserves the complete report-independent rescoring pool and native fallback identities while keeping background explanations out of training. Pooled parent sets are merged withIdentifiedOligo::mergebefore applying the database-only target/decoy rule, so background parents cannot turn a database decoy into a target. Background filtering precedes the native report cutoff. Regression checks cover both interactions.Adds an optional background search to NucleicAcidSearchEngine: a set of known RNAs that the sequence database lacks is searched alongside it, and spectra best explained by a background sequence are left out of the results, of Percolator rescoring and of the FDR calculation.
Why. Entrapment checks on HAP1 tRNA data (PXD016328) showed that many high-scoring decoy and entrapment matches were real human RNAs missing from the tRNA database: tRNA 3' end variants, mitochondrial and rRNA oligos, U6 snRNA and others. With four nucleotides and short T1 oligos, shuffled decoys and false targets often reproduce such molecules exactly or nearly. Each molecule then brings dozens of correlated spectra to whichever label it happens to match, which skews the target-decoy estimate in both directions. This follows the "subset-neighbor search" of Lin, Plubell, Keich and Noble (J Proteome Res 2021, 20:4153): background sequences and their decoys compete for every spectrum, and spectra they win are removed for targets and decoys alike. The background sequences are real ones, not hypothetical sequence variants. A prototype with all one-edit variants of the target oligos as neighbors absorbed 40% of the correct target matches and made the estimate worse.
What changes
Options (all off/empty by default; existing results are unchanged):
background:enablebackground:database: a custom FASTA. Without it, the built-in human background is used; the help text warns that it only suits human samples.background:out: a TSV of the left-out spectra and their background hits.Built-in human background,
share/OpenMS/SEQUENCES/RNA/human_background_rna.fasta, 1769 sequences:A README and the script that rebuilds it sit alongside.
RNABackgroundDatabase(NASE helper) shuffles each digestion product separately and deterministically. It keeps the enzyme's cleavage residues and the 3' residue in place, and every product of the same text gets the same shuffle, so related sequences keep shared oligos. NASE uses it to:oligo:min_size(review of [FEATURE] DecoyDatabase: per-product RNA shuffle with blacklist (shuffle_products) #10941). NASE uses the search's missed cleavages, plusvariable_max_per_oligowhen modifications can block cleavage (e.g. m7G). Components of a colliding combination try other shuffles; a change is kept only if it removes collisions around that product without creating a new one (a first version that only lowered the count moved a collision onto a mitochondrial oligo, see the review thread). Each product keeps one shuffle everywhere. Combinations of products that cannot change (e.g. G, AG) can remain and are logged. On one HAP1 file (min. length 7), colliding decoy combinations went from 1759 to 1109 (database decoys) and from 10281 to 8046 (background decoys).Labelling:
A digest written with
digest_outkeeps its background. Reusing it gives identical results, with a warning if the flag isn't set.Entrapment check.
The following figures are from the feature's earlier benchmark checkpoint; those real-data searches were not rerun for this restack.
oligo:min_size 7, no missed cleavagesLimitations (documented in
TOPP_NASE_Background)oligo:min_size 7.Tests
RNABackgroundDatabase_test: fixed residues, determinism, avoiding forbidden products, consistent rewrites, short products, missed-cleavage combinations (the review's case: targets ACGUAG and CAGAUG, RNase T1, min. length 5, one missed cleavage)TOPP_NucleicAcidSearchEngine_background(+_out,_tsv_out): targets T0–T9 moved into a custom background are left out, and no background sequence appears in the mzTabTOPP_NucleicAcidSearchEngine_background_builtin: the built-in file is foundChecklist
AI use (see the OpenMS AI Policy)
Co-authored-by:trailer, and the description above explains the design intent and rationaleNo need to edit the CHANGELOG file: entries are generated automatically once per week from merged changes.
🤖 Generated with Claude Code