Skip to content

Protein groups with picked protein-level FDR; --protein-fdr filter - #192

Merged
ypriverol merged 2 commits into
mainfrom
feat/protein-inference
Oct 20, 2026
Merged

ypriverol merged 2 commits into
mainfrom
feat/protein-inference

Conversation

@ypriverol

Copy link
Copy Markdown
Contributor

Protein inference and a protein-level FDR inside andes. A rescored run can be filtered at the protein level without andes quantification or an external inference tool. PSM q-values are not changed.

Change

  • <stem>.protein_groups.tsv, written by every rescored run. Inference works on protein families: a canonical entry with its isoform, variant and chain entries is one family. With a FASTA database, each entry is its own family. Alternative entries therefore never split a protein's evidence. Targets and decoys are treated alike:
    1. Every peptide gets the best rescored score among its PSMs.
    2. Families with the same peptides form one group.
    3. A group whose peptides are a strict subset of another group's is subsumed: it is listed with that group and not scored.
    4. A peptide still shared between groups counts for the group with the most peptides (razor).
    5. A group scores its best unique or razor peptide.
  • Picked target-decoy competition. Each target family competes with the decoy of the same family, and only the better of the two counts. q = decoys / targets over the survivors, with a running minimum. A target that loses to its own decoy gets q = 1.
  • --protein-fdr <q> (default off; also rescoring.protein_fdr in the config). The filtered TSV keeps only PSMs whose peptide counts for a group at or below q, and the proteoform table only families of such groups. A proteoform member is then a claim inside an accepted protein, and it still needs its own specific evidence at its class-aware cutoff.
  • The filtered TSV gains protein_group and protein_q.
  • Group columns: protein_group lead accessions families peptides unique_peptides razor_peptides psms best_score protein_q subsumed. The peptide counts include only peptides with a PSM at its cutoff.

Measured

Entrapment databases were used, with Percolator. A group is false when every accession in it is an entrapment entry. True FDP = entrapment groups / accepted × (1 + target : entrapment proteins).

Run PSMs at 1% Groups at protein q ≤ 0.01 True FDP At q ≤ 0.05 True FDP
Astral, shuffled entrapment (1 : 1) 42,605 4,332 1.3% 4,929 5.6%
UPS1 in yeast, E. coli entrapment (1.49 : 1) 16,147 852 5.0% 924 8.1%
  • UPS1 entrapment hits. The UPS1 entrapment groups at 1% are led by EF-Tu (36 PSMs), DnaK and ornithine carbamoyltransferase. These proteins co-purify with recombinant proteins expressed in E. coli, so most are likely present, and the shuffled-entrapment run is the better measure.
  • Astral calibration. Astral is close to nominal. It is slightly optimistic at 5%, and 29 entrapment groups at 1% put about ±0.25% of counting noise on the 1.3%.
  • Independent check. An independent offline re-implementation over the same Percolator outputs gives the same groups (4,337 vs 4,332). Variants that use only the best row of each spectrum, or only rows at PSM q ≤ 0.01, give 1.1–1.4% at 1%.
  • Score outliers. A few PSMs carry outlier rescored scores (33 against a usual maximum near 9), and the top groups' order reflects them. That only affects the ordering at the very top, not the cutoffs.

Not in this PR

  • QPX protein_groups.parquet. It stays an empty, schema-correct file.
  • Feature Parquet. Its protein-group columns are not filled yet.
  • Proteoform level. Members keep their PSM-level class and knockoff q-values. A member-level picked competition would be the next step.

Tests

  • Parsimony: indistinguishable families merge, a subset is subsumed, a shared peptide goes to the larger group, and peptides without an accepted PSM are not counted.
  • Picked competition: a family's own decoy decides, a target that loses gets q = 1, and the q-values come out as expected.
  • Config: --protein-fdr has a config key (rescoring.protein_fdr), validated as a fraction.
  • Suites: clippy is clean, and the output and andes test suites pass.

…--protein-fdr filters the PSM table and the proteoform table

Parsimony over protein families (a canonical entry with its isoform, variant
and chain entries is one family): families with the same peptides form one
group, strict subsets are subsumed, shared peptides go to the larger group.
A group scores its best unique or razor peptide; each target family competes
with the decoy of the same family, and q = decoys/targets over the survivors.
<stem>.protein_groups.tsv is written with every rescored search; the filtered
TSV gains protein_group and protein_q.
@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 19, 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 39 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: 13f6b9d6-3c80-41fe-95be-03ac8bf910cb
📥 Commits

Reviewing files that changed from the base of the PR and between fa0195a and 3b4b9a1.

📒 Files selected for processing: 8
  • DOCS.md
  • README.md
  • config.example.yaml
  • crates/andes/src/bin/andes/cli.rs
  • crates/andes/src/bin/andes/search.rs
  • crates/andes/src/config.rs
  • crates/output/src/lib.rs
  • crates/output/src/protein_inference.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 merged commit a266aec into main Oct 20, 2026
5 checks passed
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