Skip to content

Prior tiers: knockoff q-values per substitution class and claim tier - #180

Merged
ypriverol merged 4 commits into
mainfrom
feat/prior-tiers
Oct 19, 2026
Merged

ypriverol merged 4 commits into
mainfrom
feat/prior-tiers

Conversation

@ypriverol

@ypriverol ypriverol commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #178.

Claims of different reliability no longer share one error estimate. A sample's own variant calls, common polymorphisms, curated UniProt variants and catalogue entries each get their own knockoff estimate.

Change

  • Tags on every entry. Each entry's origin carries its source and a prior tier: sample, common, curated or catalogue.
    • UniProt XML claims are curated; a variant only --uniprot-evidence any admits is catalogue.
    • PEFF claims are catalogue.
    • An annotation-file row takes its tier from the new optional columns genotype, population_af, evidence and clinical_significance. The first rule that holds wins: the sample's own call, an allele frequency ≥ 0.01, curated evidence or a benign class, else catalogue.
    • When equal claims are merged, the best tier is kept.
  • Knockoff strata. Knockoff q-values are estimated per substitution class within each tier.
    • A class with fewer than 50 tested PSMs at the cutoff in a tier joins that class's other small tiers.
    • Substitution classes are never pooled with each other, because their error rates differ several-fold.
    • A run with one tier is stratified by class as before.
  • Outputs. The proteoform table gains source and prior_tier columns. The run log names each stratum (other/sample, methyl-like/pooled, …).

Validation

Setup: PXD022787 (four donors with known genotypes, TMT, 69 runs), searched against a FASTA of reviewed human UniProt plus an annotation file with UniProt's 83,472 single-residue variants.

  • In one arm, variants a donor carries were given a sample genotype, as a sample's own variant calls would be.
  • In the other arm, every variant was in one tier.

Truth comes from the donor-haplotype tags of the deposited personal protein FASTA. At --proteoform-fdr 0.05:

Setting Carried variant PSMs (variants) Donor-absent PSMs (variants) True FDP, PSMs True FDP, variants
One tier 218 (83) 13 (7) 5.6% 7.8%
Tiers split 329 (122) 8 (3) 2.4% 2.4%

Separate tiers recover half again as many carried variants and stay below the target, which one shared tier does not.

I/L sharing. The first run of this test showed 50 false variant PSMs. 42 of them were one tubulin variant, V→L, whose peptide spells tubulin alpha-1's …VIDEVR as …VLDEVR. No spectrum tells I from L, but proteins are grouped by exact sequence, so the PSMs were reported as variant-specific. Before the class FDR, a variant-class row that could be reported, real or knockoff alike, whose peptide a reference protein holds up to I/L now also names that reference. Here that is 163 PSMs.

Tests

  • I/L sharing: an I/L-equal reference peptide is shared, a truly variant peptide and rows past the cutoff are left alone.
  • Tier rules.
  • Best tier kept on merge.
  • Two tiers with enough PSMs getting separate estimates, and a small tier pooled within its class.
  • One-tier runs keeping class strata.
  • The UniProt-vs-file equivalence test, now comparing everything but source and tier.
  • Clippy is clean, and the input, model, output, search and andes test suites pass.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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 58 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 292a3dbb-518f-4cd2-a217-ec2d37c51cc2
📥 Commits

Reviewing files that changed from the base of the PR and between 57d2d8f and a3c7fe03617f9f5f1597674df0b7abe00a16d2e7.

📒 Files selected for processing: 21
  • DOCS.md
  • README.md
  • crates/andes/src/bin/andes/search.rs
  • crates/andes/tests/annotations.rs
  • crates/input/src/annotation.rs
  • crates/input/src/annotations_file.rs
  • crates/input/src/database.rs
  • crates/input/src/lib.rs
  • crates/input/src/peff.rs
  • crates/input/src/uniprot.rs
  • crates/model/src/annotation.rs
  • crates/model/src/lib.rs
  • crates/model/src/protein.rs
  • crates/output/Cargo.toml
  • crates/output/src/class_fdr.rs
  • crates/output/src/isobaric_sharing.rs
  • crates/output/src/knockoff_fdr.rs
  • crates/output/src/lib.rs
  • crates/output/src/proteoform_table.rs
  • crates/output/src/provenance.rs
  • crates/search/src/refinement.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ypriverol
ypriverol added this pull request to stack #179 October 19, 2026 05:36
Base automatically changed from feat/peff to main October 19, 2026 05:39
Every entry's origin now carries its source and a prior tier (sample,
common, curated, catalogue). UniProt XML claims are curated (catalogue when
only --uniprot-evidence any admits a variant), PEFF claims catalogue, and an
annotation file row takes its tier from genotype, population_af, evidence and
clinical_significance; merged equal claims keep the best tier. Knockoff
q-values are estimated per substitution class within each tier; a class with
fewer than 50 tested PSMs at the cutoff in a tier joins the class's other
small tiers, and classes are never pooled together, so a one-tier run is
stratified by class as before. The proteoform table gains source and
prior_tier columns.
A variant peptide that a reference protein holds once I and L are taken as
equal identifies that reference as much as the variant, but proteins are
grouped by exact sequence, so it was reported as variant-specific. Before the
class FDR, every variant-class target row that could be reported (real or
knockoff alike) whose peptide a reference holds up to I/L now also names
that reference.
@ypriverol
ypriverol merged commit 7d9d31b into main Oct 19, 2026
4 checks passed
@ypriverol
ypriverol deleted the feat/prior-tiers branch November 4, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant