Repository navigation
Rescue the pre-release fixes from #188 - #214
Merged
Merged
Conversation
The MS1 fit clamps a negative amplitude to 0, and finalize reported that as quantity 0 for an identified precursor with no signal in the run. The protein roll-up reads 0 as a measured value. Such a row now has no quantity: null in mbr.parquet and an empty intensity list in the feature parquet (the normalisation already skipped non-positive quantities). Part of #148.
apply_knockoff_fdr returned early when the database held no knockoff entry, so with --knockoffs > 0 every variant PSM was accepted on its class q-value. That happens when the enzyme leaves no position for a knockoff (nonspecific, no cleavage) or the variants are indels only. The early return now applies only with --knockoffs 0; otherwise those variants get q = 1, as documented, and the run log says how many were rejected.
mzML spectra whose native id has no scan= token (index=N from timsTOF conversions, scanId=N, SCIEX cycle/experiment ids) got no scan number, so every PIN row had ScanNr 0. The reader now takes scan=, else index=, else scanId=, else the spectrum's 1-based position in the file. Fixes #96.
The 3-fold CV assigned folds by ScanNr. With ScanNr 0 on every row, all rows fell into one fold, that fold had no training data, and --rescore-native returned almost no PSMs without a warning. Rows are now folded and grouped by their spectrum: the SpecId without its scan, rank and row suffix.
The bundle was written before the knockoff rows were removed, so knockoff PSMs appeared in psms.parquet as ordinary targets, and the feature parquet's psm_ids (row indices into psms.parquet) shifted after the first knockoff row. write_qpx now takes the rows never reported and leaves them out, as it does for rows target-decoy competition removed. Under Percolator -Y the bundle also dropped the targets that lost their scan's competition but kept the losing decoys, so a consumer computing its own target-decoy FDR from psms.parquet saw extra decoys. Losing decoys are now left out the same way.
Two counting errors made the variant knockoff q-values optimistic. The --refine Pass-2 entries copy a knockoff's origin, so each confident knockoff backbone added one to its variant's knockoff count k; k now counts distinct knockoff features. A knockoff peptide held by knockoffs of several variants counted min(1/k) once; it now counts 1/k for each variant it copies.
Each source placed knockoffs only away from its own listed variants. With a UniProt XML database and --annotations, an annotation knockoff could sit on or next to a UniProt variant, and a UniProt knockoff on or next to a variant of the annotation file (such as the sample's own genotype calls), so the knockoff was no longer surely absent. Annotation knockoffs now keep clear of the database's variant entries too, and earlier knockoffs within the knockoff distance of a variant of the file are dropped.
…im win Two counting errors in the site q-values: - A PSM whose peptide several reference entries hold counted one claim per protein but a knockoff once, which made site q-values too low for peptides shared across genes. It now counts once per stratum on both sides. - A placement that is a knockoff site in one protein and a real claim in a paralog counted only as a knockoff; for a sites=annotated mod the PSM was then removed from every output. A real claim at the same placement now wins. The module and user docs no longer say the estimate errs only towards rejecting true claims; it also misses a wrong modification at the right site, which the site identity columns address.
With --tmt PLEX, an explicit non-isobaric --protocol (e.g. phospho) and no --mods, the tag match fell through and the search ran without the TMT or iTRAQ fixed mod. --tmt now names the kit to inject whatever the protocol.
An annotation id becomes part of the entry's accession, so an id holding ';' (the VCF id separator), '|' or whitespace split the entry's accession in every protein list; the pieces were unknown accessions and the row was treated as canonical. Such rows are now left out with a reason. A PEFF modification group listing several positions (12,25|...) aborted the whole load; each position now becomes a site, and an unknown position (?) is skipped.
A proteoform-table member with no specific peptide measured in a run or channel was written as quantity 0, which reads as a measured zero. It is now NA.
The feature parquet chose the MBR schema only when its first row group carried MBR fields, so a finalize with no rows (an empty library, or every row below threshold) wrote a parquet without evidence_type, transfer_q, quant_q and quantity_se, and a reader selecting them failed. Finalize now always writes the MBR schema.
The QPX bundle, the feature parquet, the PSM TSV, the protein-group table and parquet, the proteoform table and the site table were written straight to their final path, so a failed run left a truncated file under the final name. They now write <path>.partial and rename it when complete, as the quant tables and intermediates already did.
--output-parquet writes protein_groups.parquet and, with --tmt or --lfq, quantms.feature.parquet too; psm_metavalues, PEP and the predicted RT are filled, not null; the MBR evidence types in the feature parquet are identified, transfer_ms2 and transfer_ms1; the MBR feature parquet has no PEP; rescoring adds the q-value and PEP to the QPX bundle, not to --output-tsv; and --tmt-max-pep also takes the PEP of --rescore-native.
Two database entries with the same (family, kind, sequence) overwrote each other in the map annotation claims merge into, so which one a claim joined depended on database order. The first entry now keeps the key.
|
ⓘ 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 11 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 |
…-040 # Conflicts: # DOCS.md # README.md # crates/andes/src/rescore.rs # crates/output/src/pg_parquet.rs
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.
Bug fixes from the closed pre-release PR #188 that never reached
main, re-applied on currentmain(one commit per fix). Code has moved since #188 (#189–#212), so several fixes were re-implemented rather than cherry-picked, and some #188 commits are left out becausemainalready has an equivalent change or a different design.Fixes
Identification and rescoring
scan=(mzML index= native IDs are lost in PIN ScanNr (all become 0) #96):index=N(timsTOF conversions) andscanId=Nnative ids are read as scan numbers, else the spectrum's 1-based position in the file. Before this, every PIN row had ScanNr 0.--rescore-nativereturned no PSMs, with no warning. The spectrum key is the SpecId without its_{scan}_{rank}[_{row}]suffix. The first_{scan}_followed by only one or two numbers is taken as the suffix, so a rank or row equal to the scan number does not split one spectrum's rows across folds.--tmtinjects its tag whatever the protocol: with--tmt PLEX, an explicit non-isobaric--protocoland no--mods, the search ran without the TMT/iTRAQ fixed mod.Variants, knockoffs and sites
apply_knockoff_fdrreturned early when the database had no knockoff entry, so variants were accepted on the class FDR alone (nonspecific enzyme, indel-only annotations). With--knockoffs > 0those variants now get q = 1, and the log counts them.andes inferencepasses its own--knockoffs.--refinePass-2 copies no longer inflate it. A knockoff peptide that several variants' knockoffs hold counts 1/k for each variant, where it used to count min(1/k) once.;,|or whitespace are left out with a reason, because they split the entry's accession. PEFF modification groups listing several positions (12,25|…) now load, where they used to abort the load; a?position is skipped.Outputs
psm_idsfrom shifting. It also leaves out the decoys that lost target-decoy competition, as it already did for losing targets.<path>.partialand rename it when complete.mbr.parquetand has an empty intensity list in the feature parquet, not 0 (part of quant: isomer-class precursor identity, mod-aware Percolator join check, MBR zero-vs-missing, finalize memory #148).NA, not 0.--tmt-max-pepwith--rescore-nativenow match what andes writes.Not carried over from #188
main(#211, stricter rule)main(#212)main(#212)andes inference(#209). It rebuilds the search's knockoff entries and removes knockoff PSMs from external Percolator results, so the search has to keep building them.--site-claims)mainkeeps site claims on and adds identity and occupancy (#190), which address the measured wrong-modification failure. The counting fixes from that commit are included above.mainnow keeps gated PSMs intmt.parquetand the feature parquet withquant_weight0, flaggedquant_gate_passed, and documents it. Only the--rescore-nativePEP note is included.Measured (origin/main vs this branch, same inputs)
psms.parquetrows (decoys) main → branchindex=native ids, native rescorer--refineindex=input goes from 0 PSMs to the same level asscan=input. Re-folding by spectrum changes the scan-numbered result within split-to-split variation (+3% PSMs, +0.6 points entrapment FDP). The native rescorer's FDR on UPS1 is well above nominal onmaintoo; that is a separate issue.Gate
cargo clippy --workspace --all-targets -- -D warningsclean;cargo test --release --workspace --locked: 1743 passed, 0 failed, 9 ignored; the ignored out-of-core PIN goldens pass (4/4). No golden changed. The last commit only reformats the rescued lines (rustfmt).