Repository navigation
Make per-run PINs poolable: stem-prefixed SpecIds and a data-independent PIN header - #212
Merged
Merged
Conversation
Native spectrum titles repeat across files, so PINs from separate per-file searches collided when pooled into one Percolator run, and quant library rejected the merged result. The stem prefix was applied only to multi-input searches; it is now applied to every search. The QPX spectrum_reference strips it again, so it stays the native id. Fixes #126.
The one-hot block was widened to every charge a PSM carried, so two runs searched separately could get different PIN headers, and concatenating them shifted every later column with no error. The block is now the --charge range; a declared charge outside it sets the nearest edge column.
With every SpecId carrying its file stem, per-run results passed for the wrong run share no SpecId with it and joined nothing, silently. Such a run now fails, naming the file.
…only A --predict predictor that scored no row left its columns out, and a glyco search whose MS1 fitted no precursor left the Mono columns out, so the PIN header of a run depended on its data and separately searched runs could not be concatenated. Both column sets are now written whenever they are configured, with neutral values (0, and the predictor's missing flag 1) when nothing was scored.
…e quant test Separate searches of the runs now write SpecIds that carry their file stem, so the PINs' merged Percolator result joins every run, and per-run results passed for the wrong run join nothing and are rejected.
The goldens are the previous ones with the input's file stem in front of every SpecId (and the TSV Title), and, in the high-res glyco PIN, the four Mono columns at 0 that a --precursor-mono run without fitted MS1 now writes. No golden row has a charge outside 2..5, so the charge columns are unchanged.
The guard came from a branch where quant library held the run tables in memory; it now counts the run's rows during the streamed join.
…umns; list the constant predictor columns The E. coli PINs equal the previous binary's with the file stem in front of each SpecId and the 41-44 rows of 6+ precursors moved from charge6 to charge5. The default andes-rt columns are constant on the MGF fixture, which has no retention times.
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
⛔ Files ignored due to path filters: 3
📒 Files selected for processing: 16
✨ Finishing Touches
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 |
This was referenced Oct 21, 2026
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.
Per-run searches pooled into one Percolator run (the scale workflow, the quantms route) broke in two ways on main. This PR fixes both and makes the PIN header depend only on the command line.
1. SpecIds collide across separately searched runs
A single-file search did not prefix the SpecId with the input's file stem; only multi-file searches did. Native titles (
controllerType=0 controllerNumber=1 scan=N) repeat across runs, so pooled PINs had duplicate SpecIds andandes quant librarystopped withduplicate PSMId.<stem>/, so single- and multi-file searches write the same format ({stem}/{title}_{scan}_{rank}). The stem is the file name without its last extension (run.mzML.gz→run.mzML/), as multi-file searches already did.--predictand the native rescorer key on the PIN SpecId; the QPXspectrum_referencenow strips the prefix again so it stays the native id; the TSVSpecID/Titlecarry the prefix.quant librarywith per-run results now stops when a run's result joins none of its PSMs (results passed for the wrong run), instead of passing silently.2. The PIN header depended on the data
--charge), so runs got differentchargeNranges. Concatenating them gives a header from the first file and shifted columns for the rest; Percolator does not detect this. The columns are now the--chargerange only (default 2..5), and a charge outside it sets the nearest edge column (a 6+ setscharge5). This keeps every row one-hot on a fixed set of columns. The other option, an all-zero vector, puts those PSMs on an intercept that is never learned. The glyco PIN already used a fixed range plus achargeHioverflow column and is unchanged.--predictcolumns: a predictor that scored no row (e.g. an input without retention times, including the defaultandesrton MGF) left its columns out. It now always writes them, with 0 and<p>_missing= 1.Mono*columns: they were left out when--precursor-mono autoran but fitted no spectrum (an MS2-only mzML). They are now written whenever the correction runs (--glyco,auto, mzML or.rawinput), with 0 when nothing fitted. The search itself is unchanged in that case.--charge,--predict, and for glyco the input format (MGF has no MS1, so there are no Mono columns). Runs pooled together must share those settings, as they already must share the database and modifications.Goldens
All changes are deliberate and were checked against the previous binary:
precursor_cal_off.{pin,tsv},glyco.pin,chimeric_slice.pin.gz,refine_slice.pin.gz: the previous goldens with the file stem in front of each SpecId (and TSV Title). No golden row has a charge outside 2..5.glyco_highres.pin: also gains the fourMono*columns at 0 (the fixture is an mzML without MS1).out_of_core_pin_goldens): the previous binary's PIN for each command line, with the stem added and charges clamped to 2..5, equals the new PIN row for row. The 41/44/42 rows of 6+ precursors move fromcharge6tocharge5. Row counts are unchanged.pin_constant_columns: lists theandesrt_*columns as fixture-dependent (MGF, no retention times).Verification
4 PXD042233 runs (Q Exactive HF / HF-X
.raw), each searched on its own (5 ppm, 2 missed cleavages, top-1, Carbamidomethyl, Ox-M, protein N-term Acetyl) with main and with this branch:charge2..charge9/11/14)cat→ Percolator 3.7.1quant libraryon the pooled resultcharge5).--seed 42 -Y --only-psms):The PINs differ only in the charge columns, so the remaining difference (±0.03 %) comes from folding 6+ into
charge5instead of separate charge6..14 columns.Gate (pinned toolchain 1.87):
cargo clippy --locked --workspace --all-targets -D warningsclean;cargo test --release --workspace --locked1,719 passed, 0 failed;out_of_core_pin_goldens -- --ignored4/4.Fixes #126.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation