Repository navigation
[FEATURE] MS1LabeledWorkflow: owner-aware blacklist, join of separately detected channels, targeted quantification - #10783
Conversation
…s, two-sided overlap check, satellite union, per-channel RT range Defects found while checking the SILAC attrition report in PhilRe99/openms_silac_nextflow#6 (mirrored in #10775): - Math::rankCorrelationCoefficient took two square roots, so an exact correlation of 0.5 came out as 0.49999999999999989 and failed the 'peptide_similarity' (0.5) cutoff in MultiplexFiltering; 0.4 failed 'averagine_similarity' the same way. With three isotopes this meant light and heavy needed identical intensity rank order. Now one square root of the product, as in pearsonCorrelationCoefficient. - MultiplexResolverAlgorithm::isBlacklisted_ looked only at the first blacklisted peak at or above the dummy's m/z (MZBegin), so a peak just below it was missed and the channel reported as absent (0) instead of not quantifiable (NaN). Now MSSpectrum::findNearest within tolerance. - generateMapsCentroided_ stopped collecting a point's satellites at the first duplicate ('break'), dropping the later unique ones (reachable with rt_band > 0). Now skips only the duplicate. - determinePeptideIntensities{Centroided,Profile}_ started rt_min/rt_max at 0 and only reset them for the first mono-isotopic satellite, so the 'rt_min' duration check never applied to later channels and used only the last mono-isotopic RT of the first one. Now a proper min/max per channel. - Column header sizes were incremented before a later channel could abort the multiplet. Now counted for reported multiplets only. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
… multiplet's own isotopes, applies to added channels; join separately detected channels - The two-sided blacklist lookup made the multiplet's own isotopic peaks veto its missing channels: the light M+4 peak lies ~9 ppm below a Lys4 (or Dimethyl4) channel (4.0251 Da vs. 4 x 1.0034 Da), so e.g. the re-quantified medium channel of a light-detected triplex became NaN. isBlacklisted_ now skips blacklisted peaks at the first six isotopic positions of the multiplet's detected channels (those the detection follows by default) and checks every blacklisted peak within the tolerance on either side, keeping the strict '<' boundary. - A channel added to a multiplet for an identification of it (MS1LabeledWorkflow attachToUndetectedChannels_: intensity 0, no unique id) skipped the overlap check, because the multiplet looked complete (duplex) or the handle was copied as detected (triplex). It is now checked like a missing channel (PhilRe99/openms_silac_nextflow#9). - MS1LabeledWorkflow: when no spectrum holds a peptide's complete pattern, its channels can be detected separately (partial multiplets). mergeFragments_ never merges two such partials (neither is larger), and the resolver completed each with a dummy on the other's blacklisted peaks, so the peptide got no ratio. joinChannelsOfIdentifiedPeptides_ lets an identified partial multiplet take up the partials at the m/z its peptide has in the missing channels (same charge and CV, eluting at the identification within the id_mapping tolerances, identifications of the same peptide only). Synthetic fixture MS1LabeledWorkflow_8. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…el RT range fixes Each change was traced to one fix by applying the fixes one at a time on top of develop (on which all of these tests pass): - Spearman (exact 0.5 / 0.4 no longer rejected): FeatureFinderMultiplex 4, 5, 6, 9, 11. More seeds pass the filters, so some intensities and ratios change and test 9 gains 6 features, test 11 one. - RT range per channel (the first channel no longer spans only from its last mono-isotopic satellite, which dropped multiplets with rt_band > 0): FeatureFinderMultiplex 10 gains a singlet; MS1LabeledWorkflow 1-6 detect one more (unidentified) multiplet, which changes only feature ids (and the MBR log count, 7 -> 8 unidentified); ProteomicsLFQ 3 and 9 (seeds from FeatureFinderMultiplex) get a few more seeds, which changes ids and shifts a few quantities by < 0.5%. The satellite union, the overlap check and the joining of separately detected channels change none of the existing outputs. References that did not take the change as a patch (FeatureFinderMultiplex, two of ProteomicsLFQ 3) were regenerated, keeping their input names and version strings. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…; resolver: own isotopes only by proximity Review of #10781: - joinChannelsOfIdentifiedPeptides_ compared only charge and expected channel m/z, so partials identified as different peptides of the same composition (e.g. LVNELTEFAK / VLNELTEFAK) were joined. The unlabelled sequences (other modifications kept) now have to match as well. - The join ran before keepMultiAssignedOnClosest_, so a spectrum match the mapping had attached to several partials let the first of them (not the closest) take up the partner. Multi-assigned matches are now settled before the join (and again after the attachment, as before). - The resolver attributed every blacklisted peak within its tolerance of one of six isotopic positions of a detected channel to the multiplet, which also exempted another feature's peak exactly at the dummy (the light M+4 position is only ~9 ppm from a Lys4 channel). A peak now only counts as the multiplet's own if it is closer to one of those positions than to the dummy's. New TOPP fixture MS1LabeledWorkflow_9 covers both join cases (the previous version joined the two peptides and paired the heavy channel with a ten times stronger envelope 15 ppm off: H/L 0.09 instead of ~1); the resolver class test gains a peak of another feature exactly at the Lys4 channel. MS1LabeledWorkflow_7/8 references: only the order of two meta values changed ('map_index' is now registered before 'feature_id'). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…this PR On real data (PXD022659, three injections of a SILAC Lys8/Arg10 mix, MetaMorpheus PSMs, MS1LabeledWorkflow with knock_out and requantify), each of these changes was harmful on its own against develop: - two-sided overlap check in MultiplexResolverAlgorithm::isBlacklisted_: 95 fewer quantified peptide forms; the removed ratios were mostly fine; - overlap check for channels added for an identification: 519 fewer forms; the removed ratios were 94% within 1.5x of the mix ratio; - joining separately detected channels of an identified peptide: 59 more forms, but only 44% of the new ratios within 1.5x, and 96 of the 99 existing ratios it changed got worse. The overlap veto works on an anonymous blacklist and is too imprecise to be made stricter; these changes need a different design and go to a follow-up. Restores MultiplexResolverAlgorithm, MS1LabeledWorkflow and their tests to develop and removes the MS1LabeledWorkflow_8/9 fixtures. The Spearman and FeatureFinderMultiplex fixes stay. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…rted multiplet The channel ids were numbered over the column headers that existed at that point, i.e. the channels of reported multiplets only (since the header counts moved behind the abort check, a channel used only by aborted multiplets no longer has one). A channel without a reported multiplet then got its header later, without a channel id (ColumnHeader::getLabelAsUInt() returns 1 for it), and the ids of the following channels shifted down. The ids are now set after the headers of all configured channels exist, as the channel's index. Reported by CodeRabbit on #10781. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…xact Spearman cutoffs The featureXML references of these tests were updated for the exact Spearman cutoffs in 52e783c, but their consensusXML references still held the develop values of the doublet (light 1.7945e9, heavy 1.6043e9, H/L 0.894). The PR produces 1.7822e9 / 1.5389e9 / 0.863, matching the updated featureXML. The tests passed anyway because the element lines are whitelisted ("id=") and the centroid moves by 0.7%, below the 1% tolerance. Only the centroid and the two element lines change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…kind of its sample
matchesResidues_() only checked the residue kinds that carry a label in a
pattern channel. With [][Lys8,Arg10], the pattern for one K and no R (heavy
channel {Lys8}) therefore accepted a light peptide with one K and one R: its
R count was never compared. This put the other channel at a single-label
shift (+8.014 instead of +18.022 Da):
- expectedChannelMZs() (used by MS1LabeledWorkflow to attach identifications
of undetected channels) returned the wrong channel m/z,
- resolve() completed a light singlet of such a peptide with a dummy at the
wrong position (re-quantified there by MS1LabeledWorkflow), and accepted a
Lys8 doublet as that peptide,
- checkIdentifications() agreed with such a doublet.
Partially labelled peptidoforms (e.g. heavy R, light K) matched the
single-label pattern the same way.
A channel now has to carry, for every residue kind its sample labels, one
label per residue of that kind, i.e. none if the peptide has none. The
sample of a channel is the one in 'algorithm:labels' whose labels include
the channel's labels (not its position, since the light SILAC sample can be
implicit). Unlabelled channels impose nothing; Dimethyl, ICPL and numeric
labels are still not counted. Residue kinds a sample does not label impose
nothing either ([][Lys8] still shifts a K+R peptide by Lys8 only).
On the PXD022659 data, this explains all four joined K+R peptides that got
a partner at a single-label shift (LEELDADKAEMR, IEERHREMENAIK, TKEELEAEKR,
and IDLGKANEPNHVELGR, whose only PSM in that run is the heavy-R/light-K
form). Run 028 has 2242 PSMs of light K+R peptides and 525 partially
labelled PSMs.
No reference output changes: the only SILAC resolver fixture
(MultiplexResolver_1) and the MS1LabeledWorkflow fixtures contain no peptide
with both K and R; MultiplexResolver_2/4 (Dimethyl) and _3 (Leu3) are not
affected. All resolver and workflow test outputs were compared with the
previous build and are identical apart from unique ids.
New class tests (fail before this change): a light K+R singlet is
completed at the combined shift and a Lys8 doublet with that identification
is a conflict; checkIdentifications() rejects it; expectedChannelMZs() gives
the combined shift for duplex and triple SILAC and with an implicit light
sample, no pattern for 2K+R beyond max_nr_labelled_aas, without K/R, or for
a partially labelled peptide; K-only/R-only, [][Lys8] and Dimethyl are
unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…d only by another peptide
Until now the blacklist was anonymous. The resolver made a missing channel NaN, and so never
re-quantified, whenever any reserved peak lay at its position. MS1LabeledWorkflow's
re-quantification skipped every reserved peak, whoever had reserved it. On the PXD022659 data,
59% of those vetoes came from reservations no reported feature owns (clusters dropped by
rt_min), and 16% from the peptide's own other channel.
- MultiplexFiltering records, for every reserved peak, the filtered peak (pattern, index in the
filter result) and the mass trace it was reserved for. They are written together with the role
value in the serial accept steps, so they are the same for any number of threads. The new
getter getBlacklistOwners() returns them aligned with getBlacklist(). The undefined
blacklistPeak_(peak) declaration is removed.
- FeatureFinderMultiplexAlgorithm maps each owner to the unique id of the feature of its
channel in the reported multiplet of its cluster, or to 0 if the multiplet was not reported.
The ids are recorded per (pattern, cluster, channel) inside generateMaps*_, not by position,
since a channel can lack a feature and the provisional ids of aborted multiplets are reused.
Each blacklist spectrum carries them as two IntegerDataArrays aligned with its peaks,
"owner_unique_id_high" and "owner_unique_id_low" (the 32-bit halves of the UInt64 id). The
arrays survive mzML. The wrong "per-pattern blacklist" comment is fixed.
- MultiplexResolverAlgorithm gets public static helpers: hasBlacklistOwners(), blacklistOwner(),
setBlacklistOwners(). It also gets one classification rule: ownerPeptides() and
classifyBlacklistOwner() give orphan / own / same peptide / unidentified / other peptide, and
isForeign() decides whether an owner vetoes. Same peptide means the same sequence without the
labels of algorithm:labels, at the same charge. With owners:
- lookup is two-sided;
- only foreign owners (unidentified or other peptide) veto;
- channels added for an identification (intensity 0, no uid), including complete multiplets,
are checked as well;
- a log line counts the vetoes, separately for missing channels and added channels, by owner class,
the channels whose reserved peaks belong to no other peptide, and the vetoes the anonymous check
would have given.
Without owner arrays, behaviour is unchanged.
- MS1LabeledWorkflow:
- mergeFragments_ returns flank channel -> coinciding channel of the kept multiplet, and the
blacklist owners of merged flanks are remapped to it;
- requantifyChannel_ takes a reserved-peak filter, and requantifyMissingChannels_ skips only
peaks with a foreign owner, using the resolver's classification;
- a log line counts the reserved peaks it now uses, by owner.
Tests:
- resolver: owner arrays (64-bit round trip, sort, mzML), hasBlacklistOwners(), classification,
and resolve with owners (orphan/own/same peptide -> 0, other peptide/unidentified -> NaN,
anonymous -> NaN as before, a peak below the dummy counts only with owners, added channels in
duplex and triplex);
- FeatureFinderMultiplexAlgorithm: owners = reported feature uid per channel, orphans for a
multiplet dropped by rt_min, profile path, per-cluster ids incl. a channel without a feature;
- MultiplexFilteringCentroided: the same owners for 1/2/4/8 threads.
Real data (run 028, RT 2400-3600 s): of 182 missing channels, 49 are not quantifiable (103 without
owners); 38 of 295 added channels are newly not quantifiable. 203 channels lie on reservations of
the same peptide or of no reported feature. 329 channels are re-quantified (307 before) and 61 are
absent (67 before).
Reference outputs: none changed. The MS1LabeledWorkflow test outputs are byte-identical to the
previous build. Fixture 7 shows one triplex channel that the owner-aware check classifies as
lying on its own multiplet's reservation; no veto changes, and no re-quantification uses a
reserved peak. MultiplexResolver_4 uses an anonymous blacklist.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…d channels and re-measures them over common spectra When no spectrum holds a peptide's complete pattern, FeatureFinderMultiplex can report its channels as separate partial multiplets. mergeFragments_ does not merge them (neither is larger), and the resolver completes each with a dummy on the other's peaks, so the peptide gets no ratio. The first attempt to join them (660aac7, dropped in 3678944) paired the right channels in most cases on real data (PXD022659), but it kept the two FFM partial intensities. Those were measured over different spectra and isotope counts, so only 41 % of the joined ratios were within 1.5x of the mixing ratio. New option -join_channels (default false until measured on the full data): - Candidate search as in 660aac (after settling multi-assigned spectrum matches, before attaching IDs to undetected channels; same charge and CV, eluting at the identification, all channels among the missing ones, IDs of the same unlabelled peptide only). The m/z must now match the expected channel m/z within the detection tolerance (algorithm:mz_tolerance, 6 ppm) instead of id_mapping's 20 ppm, for the candidate and for the target's own channels. This removes the abundant other species at 14-18 ppm that caused most of the remaining wrong partners. - The most intense channel keeps its intensity. The channels of the other partial multiplet(s) are re-measured against it with requantifyChannel_ (paired peaks) over the union of the two channels' elution regions, with as many mass traces as both have. The joined channels' own reserved peaks are used: owner-aware blacklist, the same classification as the re-quantification. On the real data the paired ratio over the hull union was within 1.5x for 96 % of the joins. - A candidate with fewer than 6 spectra of paired peaks is not joined (accuracy 60 % with 3-5, 92 % with 6-9, 98 % with 10 or more paired spectra). - No elution-correlation gate: on the real data it did not separate good from bad joins (AUC 0.48-0.60). - requantifyChannel_ can report the number of paired spectra. FFM's centroided experiment is also kept when only the join needs it. With -join_channels false (the default) the code path and every existing test output are unchanged. Sanity check on one real run (PXD022659 run 028 alone, -join_channels true vs false): - 71 joins; 8 candidates rejected for too few paired spectra. - 24 peptide forms gained, all within 1.5x of 1:1. - 40 existing ratios changed: within 1.5x 98 % before, 100 % after. - 1 form lost: DLLFQALGR, which shared a light singlet with the isobaric LVFGFLNGR(Arg10). The singlet is now joined to LVFGFLNGR's light channel, the peptide of its best identification (H/L 0.87; the FFM intensities would give 2.9). Tests (all with -join_channels true): - MS1LabeledWorkflow_8 and _9: the fixtures of 660aac7, regenerated byte for byte by their generators. - 8: LVNELTEFAK is joined. H/L is now 0.956 (re-measured); 660aac kept the FFM intensities: 0.935. - 9: the composition-identical LVNELTEFAK/VLNELTEFAK are not joined. YVNDLAGHEK is joined to its exact light channel, not to the 10x envelope 15 ppm above it. H/L 0.955 (660aac: 0.928). - Against the 660aac references, only the joined channel's intensity and the ratios derived from it differ. - New MS1LabeledWorkflow_10, channels detected over very different elution regions: - TLSDYNIQK 1:1 (FFM hulls 4 s vs 26 s): FFM intensities would give H/L 3.0, re-measured 0.954. - ALVAYYQK 5:1: the narrow light channel is the reference, and the heavy one is re-measured from peaks it reserved itself: 0.191 instead of 0.60. Without the owner-aware filter it would not be joined. - VSFELFADK: light and heavy share only 5 spectra, so they are not joined. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…ified peptides that have no multiplet An identified peptide without a multiplet in the run (none detected, or its identifications fit none) was kept for protein inference only. With -targeted_quantification true (default false) it is measured from the MS1 peaks at the m/z it has in every channel, after the re-quantification and while the handles still name their channels: - Candidates: unassigned identifications with a target best hit whose labels fit a pattern (expectedChannelMZs), of a peptide (label-stripped sequence, charge, CV) that no resolved multiplet quantifies within algorithm:rt_typical of its elution region (abundances add up per peptide and charge, so nothing is measured twice). - Extraction: nearest peak within algorithm:mz_tolerance for isotopes 0-2 of every channel in the detection's centroided spectra, ID RT +/- algorithm:rt_typical, same CV. Peaks reserved for a multiplet of another identified peptide are left out; peaks of unidentified multiplets and orphans are used. - Boundaries: sum of all channels' first two isotopes, smoothed and split at minima with ElutionPeakDetection's smoothData/findLocalExtrema (detectPeaks itself fails on a split part of zeros only), trimmed to the positive smoothed region; the peak containing the ID, else the nearest within id_mapping:rt_tolerance. - Reference = the identified channel. It needs M0 and M1 in >= 3 spectra without a strong peak one isotope below (another envelope, the detection's zeroth-peak rule) and an isotope pattern that fits the sequence (Pearson >= algorithm:averagine_similarity). Its intensity is the trapezoid area of its isotope traces (PeakIntegrator, as the detection integrates), its RT the intensity-weighted mean of its monoisotopic peaks. - Other channels from paired peaks against it (pairedIntensity_, the kernel requantifyChannel_ now uses as well), reported if paired in >= 2 spectra and co-eluting (Pearson of the isotope-summed profiles >= algorithm:peptide_similarity); else 0 if nothing is there, not quantifiable (no handle) if something is. - One consensus feature per elution peak (m/z = lightest channel, setUniqueId, FAIMS_CV), carrying every identification of the peptide in that peak, moved out of the unassigned ones, with map_index = its own channel. The feature and these identifications get quantification_method = "targeted" (only the identifications' value survives linking). MultiplexResolverAlgorithm gets peptideKey() (the key ownerPeptides() uses, now shared) and a classifyBlacklistOwner() overload for a peptide without a multiplet. Tests: MultiplexResolverAlgorithm_test sections for both. New fixture MS1LabeledWorkflow_11 (synthetic SILAC duplex) with TOPP tests 11_targeted (log regex, consensusXML, QPX psm view) and 11_default. Its cases cover: a weak doublet (two IDs, one feature, H/L 0.95); an already quantified peptide; a decoy; an ID on another envelope's second isotope (conflict), rejected by the lower-isotope check; light only (heavy 0); a heavy buried under another identified peptide (not quantifiable); an unidentified doublet's peaks used (H/L 0.94); a non-co-eluting heavy (not quantifiable). Throwaway builds without the lower-isotope check, with unidentified owners skipped, with no reserved peak skipped, or without the co-elution gate each change exactly the case meant for it. No existing reference changed; the outputs of all existing MS1LabeledWorkflow test commands are byte-identical to the previous commit. Real data (PXD022659 run 028 alone, same options): identified forms quantified 38.7% -> 67.7% (+5194 cells, none lost); targeted cells 92.6% within 1.5x of the run median (detected 96.5%); on the 2465 targeted cells MetaMorpheus also quantifies, 93.9% vs MetaMorpheus' 83.2%. Runtime 7:39 vs 7:27 min. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
… targeted conflicts Resolver (MultiplexResolverAlgorithm): - New parameter algorithm:use_blacklist_owners (default false). Without it the owner arrays FeatureFinderMultiplex now always writes are ignored, so MultiplexResolver, pyOpenMS resolve() and MS1LabeledWorkflow -requantify false keep the old semantics (a dummy left at 0 in owner mode only means "not occupied" and must be measured). MS1LabeledWorkflow sets it from -requantify and hides it from its resolver section. - isForeign() includes SAME_PEPTIDE: another multiplet of the same peptide is quantified itself, so it vetoes a missing channel instead of being re-quantified into it (counted twice). Merged flanks and joined partners are OWN and unaffected. MS1LabeledWorkflow: - Re-quantification and join use a reserved peak only if the measured channel reserved it itself or no reported feature did (mayUseReserved_). A missing channel is no longer measured from the multiplet's own isotopes (triple SILAC Lys4 medium on light M+4) nor from a same-peptide multiplet. - Targeted quantification: an ID whose channel lies on a quantified channel of another peptide's multiplet (near its elution region) is not measured; of targeted peaks of different peptides that read the same peaks only the best-scoring ID's is kept; an unidentified multiplet kept for match between runs whose peaks a targeted feature read is replaced by it. Tests: new TOPP tests MultiplexResolver_5(_owners), MS1LabeledWorkflow_9_default, _9_join_tolerance, _11_conflicts, _11_targeted_mbr, _12_reserved (new triple SILAC fixture: own-isotope dummy, orphan re-quantification, merged-flank remap); resolver class tests for the parameter and SAME_PEPTIDE. Six existing workflow log regexes contained ';', which CMake splits into alternative regexes (only one half was enforced); ';' replaced by '.'. No existing reference output changed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
… MBR replacement, conflict pass MS1LabeledWorkflow -targeted_quantification (second review round, findings 1-3, 6, 7, 9, 12): - #1/#7: the peaks of an unidentified multiplet are used only if it can be the peptide (same charge and CV, every channel at one of the peptide's channels); otherwise they are left out like another peptide's, so the channel is not quantifiable. The owners a targeted feature records are only those of reserved peaks that entered a reported intensity (the reference, or a channel measured > 0), so an unidentified multiplet kept for match between runs is replaced only when it is the targeted peptide. Unrelated co-eluting multiplets stay. - #6: a non-identified channel's peak at an isotope (k >= 1, up to the isotopes the detection assigns to a channel) of another channel whose monoisotopic peak is in the spectrum is left out (e.g. Lys4 medium on the light M+4), so such a channel is not quantifiable (NaN) instead of measured from the other channel's isotopes. - #2: a non-identified channel on a quantified channel of another peptide's multiplet near its elution region is not quantifiable (its peaks are left out), as the identified channel already was. - #3: the conflict pass between targeted peaks uses only measured channels (intensity > 0), in both directions; the identified channel always is one. Tests: new TOPP tests MS1LabeledWorkflow_12_targeted (fixture 12 targeted, medium on light M+4 not quantifiable), _13_targeted and _13_targeted_mbr with a new synthetic duplex fixture 13 (unrelated unidentified doublet at a heavy m/z, kept for match between runs and identified by linking; another peptide's tail at a heavy m/z; a NaN channel at another targeted peptide's m/z; a worse-scoring identification that sorts first in map order and only reads the kept peak's identified channel (#9); a wrong isotope pattern (#12)). Each new test fails with the previous code; each fix fails at least one of them when reverted, except the reported-intensity filter of the recorded owners. No existing reference output changed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…ns not quantifiable, join on by default
Owners of reserved peaks (MultiplexFiltering, FeatureFinderMultiplexAlgorithm):
- A peak that another filtered peak reserved before keeps a record of the first writer and its mass trace
(sparse map next to the last writer). getBlacklistOwners() returns both (BlacklistOwner{first, last},
BlacklistWriter per writer). FFM takes the first writer's feature if its multiplet was reported, else the
last one's, else none. So a later pattern whose RT band reaches back over a reported multiplet's peaks and
that is dropped no longer turns them into orphans. Blacklist values, detection and thread determinism are
unchanged (owner arrays identical with 1 and 4 threads; with rt_band 0 identical to before).
- Class test: rt_band 5, a doublet whose light channel outlasts the heavy one, followed by a dropped singlet on
its tail: the overlapping peaks keep the doublet's light uid. The thread test compares both writers.
Re-quantification (MS1LabeledWorkflow):
- requantifyChannel_ returns NaN (not quantifiable) instead of 0 when the channel would have a value with the
reserved peaks it skipped (pairedIntensity_ on all peaks at its position), e.g. a triplex medium channel on
the light channel's own M+4. The log counts these separately from the absent channels. Fixture 12: the
medium channels of SAGLEVDNVLGTSLEAPYNAPLLEK and TPELGSVDNALAYNGLSVEPLTAEK change from 0 to not
quantifiable (reference updated).
-join_channels is true by default:
- Help text and documentation updated; TOPP_MS1LabeledWorkflow_9_default passes -join_channels false.
- The 7_partial and fixture 12 references change only in the order of a consensus feature's meta values: the
join strips the labels of a copy of each identified partial multiplet's hit, which registers the MS1Label
meta value names before feature_id.
Tests:
- TOPP_MS1LabeledWorkflow_12_no_requantify: -requantify false runs the resolver without owners (FAIL regex
"Blacklist with owners"; reference with LVNELTEFAK's light channel not quantifiable).
- New fixture MS1LabeledWorkflow_14, TOPP_MS1LabeledWorkflow_14_join: a joined heavy channel is re-measured
without the peaks an unidentified multiplet reserved at its position (H/L ~1, not ~1.25), and an
identification on an envelope 12 ppm off its light channel is not joined to the exact heavy partial
multiplet next to it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…hannel's peak; pin the owner remap, other-peptide and conflict rules Another channel's isotope at a channel's position (measureTargeted_): - A non-identified channel's peak at an isotope (k = 1..max of algorithm:isotopes_per_peptide - 1) of another channel is no longer left out on the m/z alone. The expected part of it (that channel's monoisotopic peak in the spectrum times I_k/I_0 of the identified sequence's isotope distribution) leaves it out only if it is at least 20 % of the peak; a smaller part is subtracted. So a triple Dimethyl heavy channel, 4 ppm from the medium's M+4 (~2 %), is measured again (it was not quantifiable whenever the medium was present); a Lys4 channel on the light M+4 of a 2.6 kDa peptide without medium signal stays not quantifiable. - New fixture MS1LabeledWorkflow_15 (triple Dimethyl), TOPP_MS1LabeledWorkflow_15_targeted: SVEDLAFGNYQR 1:1:1 with the medium's unresolved M+4/M+5 in the heavy peaks gives H/L ~1. Tests for rules that no test checked any more: - Other-peptide reserved peaks in the targeted path: in fixture 15, FTDNTDLFR's heavy m/z is the light M+1 of the identified triplex GDVTALFEQR; those reserved peaks are left out (heavy not quantifiable, not measured from them). - Owner remap of merged flanks: TOPP_MS1LabeledWorkflow_12_owners checks the owner counts of the fixture 12 log (without the remap the medium channel of TPELGSVDNALAYNGLSVEPLTAEK is vetoed instead, with the same consensusXML). - Reverse half of the targeted conflict pass: TOPP_MS1LabeledWorkflow_13_swapped runs fixture 13 with the scores of NVYDLGSEK and AHQQQQHR swapped (MS1LabeledWorkflow_13c.idXML); NVYDLGSEK's not quantifiable heavy channel at AHQQQQHR's identified channel does not drop it. - Test comments of fixtures 11 and 12 updated. No existing reference changes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…the identified channel, same-centroid overlap rule
measureTargeted_ estimates the part of a lower channel's isotope in a channel's peak from that
channel's monoisotopic peak. Three problems with it:
- F1: the lower channel's monoisotopic peak was taken raw, so it could hold a third channel's
isotope. In triple Dimethyl R-peptides of 1.95 kDa and up, the light M+4 sits in the medium M0,
so the heavy lost an extra L*(I4/I0)^2 or was left out (2.5 kDa 1:1:1: heavy NaN; 1:0:0.5:
H/L 0.478). Now the channels of each spectrum are corrected in ascending m/z, and each
monoisotopic estimate is taken without the isotopes of the channels below it. This is the
triangular case of the overlap system, so one pass solves it. It also holds when the lower
channel is the identified one.
- F2: the identified channel was never corrected, so H/L depended on which channel was
identified (fixture 15 heavy ID: 1.018 vs 1.000 for the light ID). The expected part is now
subtracted from the identified channel's peaks too, before they become the reference. If
another channel's isotope makes up at least targeted_other_isotope_fraction_ of them, they stay
the reference. The other channels' paired intensities cancel a constant reference error. But
the identified channel's own intensity is then reported not quantifiable, as a non-identified
channel would be, unless min_targeted_reference_spectra_ clean spectra are below that fraction.
Dropping the reference spectra instead would lose the whole feature; reporting the value would
carry an unbounded estimate error. A new log line counts such features.
- F3: an overlap was corrected only within algorithm:mz_tolerance (6 ppm), a mass-accuracy
window. The Dimethyl4/Lys4 channel on the light M+4 (0.0117 Da) stayed uncorrected below
~1.95 kDa, although at usual MS1 resolution (FWHM 14-30 ppm) it is unresolved. Now an isotope
is part of a channel's peak if that peak is also the nearest peak to the isotope's m/z within
twice the tolerance, i.e. the same centroid. Twice the tolerance is the window MultiplexFiltering
uses to look for peaks of another envelope (and the workflow's lower-envelope check). A resolved,
visible isotope has a centroid of its own and is not taken off its neighbour.
Docs: quantifyTargeted_ describes the overlap rule, the ascending correction and the identified-
channel rule; the -targeted_quantification help mentions the subtraction and the 20 % rule.
Tests: fixture 15 regenerated (generator reproduces the old and the new files byte for byte).
- Isotopes are merged within the FWHM at a resolution of 120,000 at m/z 200, instead of 7 ppm.
The 7 ppm window sat between SVEDLAFGNYQR's two Dimethyl offsets (4.1, 8.2 ppm) and dropped
the light M+4 although it is above the noise level.
- Ten isotopes per species instead of six.
- New light-ID cases:
- SVEDLAFGNYQSVEDLAFGNYR 2.5 kDa 1:1:1 (chain: 17 % in both the medium and the heavy)
- SVEDLAFGNYQGEDVTALFEQLR 1:0:0.25 and SVEDLAFGNYQGEDVTALFEQR 1:0:0.5, with the light M+4 at
the medium's m/z
- TALFEQLSVEDLAFGNYQGDR 1:2:1 (heavy 26 % medium M+4)
- New tests 15_heavy_id and 15_medium_id (+_out1) run the same data with peptides identified as
heavy or medium. The values agree with the light IDs within 0.3 %. TALFEQLSVEDLAFGNYQGDR's
identified heavy is reported not quantifiable, M/L 2.
Reference changes (MS1LabeledWorkflow_15_out.consensusXML; no other reference changed, all other
outputs of the 89 MS1LabeledWorkflow tests are identical to fa3a1ee):
- SVEDLAFGNYQR medium 1314428 -> 1314363. The new fixture merges the light M+4/M+5 into the
medium M0/M1 (+1.8 %, which fa3a1ee keeps: 1338196); the new rule subtracts it.
- SVEDLAFGNYQR heavy 1314363 -> 1314387. The medium estimate is now without the light M+4
(fa3a1ee subtracted an extra L*r4^2, -0.05 %); +0.002 % from the light M+8 now generated.
- GDVTALFEQR (detected) medium +0.99 %, heavy +0.006 %, the same with both binaries. The
generator merges the light M+4 (10 ppm) into the medium M0, and the detection does not
correct overlaps.
- New features for the four new peptides, protein abundances accordingly. Log counts: 6 features
(7 measured, 1 absent, 4 not quantifiable), was 2 (2/1/1).
Fail-before:
- With the fa3a1ee binary, all six fixture-15 tests fail.
- Mutants:
- raw monoisotopic estimate: 15_targeted, 15_medium_id (+out1), 15_heavy_id_out1,
12_targeted (+out1)
- identified channel uncorrected: 15_heavy_id (+out1), 15_medium_id_out1
- identified channel always reported: 15_heavy_id (+out1)
- old 6 ppm criterion: the three fixture-15 _out1 tests
Duplex Lys8/Arg10 (no channel within k <= 5 isotopes of another): the run-028 window with
-targeted_quantification is identical except ids/dates.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…ts peaks in the conflict pass; fall back to its measured peaks if the subtraction removes them Since the identified channel can be reported not quantifiable (NaN), two fixes in MS1LabeledWorkflow's targeted quantification: - One signal, one peptide: the conflict pass registered and checked only channels > 0. Two identifications on the same peaks whose identified channels were both NaN (e.g. heavy-identified isomers on a heavy that is mostly the medium's M+4) were both kept with identical values. A peak now reads its identified channel whatever its reported value (it is the reference of the other channels) besides its measured ones. - The subtraction of the other channels' isotopes is clamped at 0 and also applies to the identified channel. An unrelated peak at a lower channel's m/z, taken for that channel, could remove the identified channel's peaks in every spectrum, and the feature was lost with the channels the light-ID run measures. If the subtraction leaves the identified channel fewer than three reference spectra although its measured peaks have them, the subtracted part cannot be right: its peaks are used as measured (reference, isotope gate, RT, lower-envelope check, co-elution profile), and its own intensity is not quantifiable. Nothing changes for features that keep their reference spectra. Fixture 15 (triple Dimethyl) gains SVEDLAFGNYQGEDVTALR 1:0:1 with an unrelated co-eluting peak at the absent medium's m/z (light ID; heavy ID in _heavy.idXML) and, in _heavy.idXML, a worse-scored heavy isomer of TALFEQLSVEDLAFGNYQGDR. References: one new feature (L only, as with the light identification) and the protein that comes with it; in the heavy-ID run the isomer stays unassigned. Existing features unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
|
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 15 minutes. View limit details
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Record blacklist writers src/openms/include/OpenMS/FEATUREFINDER/MultiplexFiltering.h, src/openms/source/FEATUREFINDER/MultiplexFiltering.cpp |
Filtering records the first and latest accepted peak that wrote each blacklist entry and exposes the ownership records in blacklist order. |
Map reservations to features src/openms/include/OpenMS/FEATUREFINDER/FeatureFinderMultiplexAlgorithm.h, src/openms/source/FEATUREFINDER/FeatureFinderMultiplexAlgorithm.cpp, src/topp/FeatureFinderMultiplex.cpp |
Feature generation collects provisional per-channel IDs, maps blacklist writers to final feature IDs, and assigns channel headers by configured channel index. The blacklist option description documents owner IDs. |
Resolve channels using owners src/openms/include/OpenMS/FEATUREFINDER/MultiplexResolverAlgorithm.h, src/openms/source/FEATUREFINDER/MultiplexResolverAlgorithm.cpp, src/topp/MultiplexResolver.cpp |
When enabled and valid owner data is available, the resolver classifies nearby reserved peaks and applies owner-aware checks to missing and identification-added channels. Pattern matching uses sample label sets. |
Regression coverage src/tests/class_tests/openms/source/*Multiplex*, src/tests/topp/CMakeLists.txt, src/tests/topp/FeatureFinderMultiplex_*, src/tests/topp/MultiplexResolver_5_*, src/tests/topp/MS1LabeledWorkflow_* |
Tests cover blacklist ownership, feature mapping, owner-aware resolution, label matching, channel joining, and targeted quantification. Test fixtures record the corresponding expected outputs. |
Rank-correlation calculation
| Layer / File(s) | Summary |
|---|---|
Update calculation and expected outputs src/openms/include/OpenMS/MATH/StatisticFunctions.h, src/tests/class_tests/openms/source/StatisticFunctions_test.cpp, src/tests/topp/ProteomicsLFQ_* |
The denominator expression changes, tests add exact correlation checks, and ProteomicsLFQ expected-output fixtures are updated. |
Sequence Diagram(s)
sequenceDiagram
participant FeatureFinderMultiplex
participant MultiplexFiltering
participant MultiplexResolverAlgorithm
FeatureFinderMultiplex->>MultiplexFiltering: collect blacklist reservation writers
FeatureFinderMultiplex->>MultiplexResolverAlgorithm: provide owner IDs with blacklist
MultiplexResolverAlgorithm->>MultiplexResolverAlgorithm: classify nearby owners
MultiplexResolverAlgorithm->>MultiplexResolverAlgorithm: evaluate missing and added channels
Possibly related PRs
- OpenMS/OpenMS#10692: Both changes track information about blacklist writes and use it to connect reserved peaks to their writers.
- OpenMS/OpenMS#10781: This PR builds on feature-finder behavior that
#10781changed, including rank correlation, retention-time ranges, and channel indexing.
Change: Feature · Severity of issue fixed: Medium
Merge Risk: 
Minimal · previous review 19dbc
-
No actionable merge-blocking issue was established. The change is mergeable after normal checks.
Pre-merge checks: 
2 · 
3
-
Failed checks: 3 warnings Passed checks: 2 passed-
Full details: Title check
-
Explanation
The title names the three main changes to MS1LabeledWorkflow: owner-aware blacklist handling, joining separately detected channels, and targeted quantification. The raw summary and PR objectives confirm that these changes are the main body of work, with residue-matching fixes and test/fixture updates as supporting changes. The title is 114 characters, which is long, but it stays on topic and does not use vague terms.
-
Full details: Linked Issues check
-
Explanation
The owner-aware blacklist, targeted quantification, quantification-method flag, residue matching fix, and related tests address the corresponding requirements in
#10782. The channel-join implementation does not establish that unidentified partial multiplets belong to the same peptide. It uses charge/CV, identification RT, expected-channel m/z, and a minimum of six paired spectra. The supplied evidence states that it has no elution-profile correlation gate. The issue identifies m/z and RT proximity as insufficient for this join decision.Resolution
Add a join criterion that verifies shared peptide signal for unidentified candidates, such as correlated elution profiles with overlapping RT extent or an equivalent discriminator. Add regression coverage for rejection of unrelated partial multiplets.
Full details: Out of Scope Changes check
-
Explanation
The change to
Math::rankCorrelationCoefficientinsrc/openms/include/OpenMS/MATH/StatisticFunctions.hand its exact-value test inStatisticFunctions_test.cppare not connected to the#10782MS1LabeledWorkflow requirements. The associated ProteomicsLFQ output fixture changes are also outside the stated workflow, blacklist, resolver, join, and targeted-quantification scope.Resolution
Remove the unrelated rank-correlation and dependent ProteomicsLFQ fixture changes, or link them to a separate issue with coding requirements.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 20.51% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 39 functions across 13 files. (74 skipped: 74 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- 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.
A rabbit records each peak in the queue,
First and last owners come into view.
Channels are checked by label and trace,
Ratios find room in a measured place.
The moonlit tests mark each path anew.
…verage develop's only new commit is the squash of #10781, whose tree equals 78bfeaa, the #10781 head this branch is built on; so this branch's tree is kept as is. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…oxygen reference '@ref run:' made doxygen look up 'run:' (Doxygen_Warning_test failed on CI). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
timosachsenberg
left a comment
There was a problem hiding this comment.
AI-generated initial review
This is an automated, AI-generated first review. It looks for high- and medium-priority issues only (no nits) and checks whether the PR has tests and measurements. I read the code at 81788e34 against develop (a3e7dea0). Please double-check anything before acting on it. A maintainer will follow up.
I could not build or run OpenMS here, because the vcpkg sources and Arrow ≥ 24 are not available. I did port MultiplexResolverAlgorithm::matchesResidues_ to a standalone Python check (K, R, K+R, KK and KK+R peptides; [][Lys8,Arg10], plus a triplex whose medium sample labels only K). CI is green at this head on every platform, Windows included.
Verdict: I found no high- or medium-priority issue. The owner bookkeeping does not change what FeatureFinderMultiplex detects. The new resolver option is off by default outside MS1LabeledWorkflow. The existing MS1LabeledWorkflow references stay the same apart from the explained meta-value order. The open points are a FAIMS test and a runtime/memory number for the default path.
Checked and found sound
- Blacklist owners (
MultiplexFiltering).applyBlacklistEntries_writes the same entries, with the same values and in the same order, as before. The owners are only recorded next to them.- So a peak cannot be claimed by anything that could not claim it before, and no pattern loses peaks.
- In the parallel path, the owners are written in the serial, m/z-ordered acceptance loop, so they do not depend on the thread count. The extended test checks this for 1, 2, 4 and 8 threads.
FeatureFinderMultiplexAlgorithm.unique_id_of.at(owner)(FeatureFinderMultiplexAlgorithm.cpp:1240) cannot throw. Only channels of reported multiplets entermultiplet_ids, and all their features are infeature_map_.- The owner arrays are built in the same loop order as
getBlacklist(), so they stay aligned with the peaks. - The featureXML and consensusXML outputs are unchanged. Only
-out_blacklistgains the two integer arrays, and no FeatureFinderMultiplex reference changed.
- Resolver.
algorithm:use_blacklist_ownersdefaults to false. So MultiplexResolver output only changes through thematchesResidues_fix, and the MultiplexResolver_1–4 references are unchanged.- In my port, a light K+R peptide with
[][Lys8,Arg10]now matches only the Lys8+Arg10 pattern. Before, it also matched the Lys8-only and the Arg10-only patterns. K-only, R-only, KK and no-K/R peptides match as before. - One correction for the description: it says only unidentified and other-peptide owners make a channel NaN.
isForeign()(MultiplexResolverAlgorithm.cpp:475) and the docs count same-peptide owners as well.
- MS1LabeledWorkflow default path.
- References 1–6 are unchanged. So is
3_targeted, which runs withrt_band 5, so its peaks are reserved by several patterns. - In
7_partialonlyfeature_idmoves. The join callsunlabelled_()→stripLabels_(), which registers theMS1Label:*keys earlier. That matches the description.
- References 1–6 are unchanged. So is
- Join.
- A partner needs the same charge and CV. Its m/z has to be within the detection's ppm tolerance of
expectedChannelMZs(), and the identification RT within its hull ±id_mapping:rt_tolerance. - Each partner is used once (
taken). Its identifications move to the target and the partner is removed, so nothing is counted twice. - Each pass of the rejection loop drops one partner, so the loop always ends. The second
keepMultiAssignedOnClosest_replaces themap_index 0placeholders. - The flank chain in
mergeFragments_cannot cycle, because sizes strictly increase along it.
- A partner needs the same charge and CV. Its m/z has to be within the detection's ppm tolerance of
- Targeted quantification (off by default).
- Identifications without signal stay unassigned.
- Peptides without a labelable residue, or without a fitting pattern, are skipped (
no_pattern). - The peptide key includes the charge. So a charge state without a multiplet is measured as its own ion and does not add to the multiplet's value.
- NaN channels are dropped before output.
- Savitzky–Golay leaves windows shorter than its frame unsmoothed instead of failing.
- OpenMP. The only parallel region is in
MultiplexFiltering::filterSpectrum_. The resolver and the workflow code are serial. - pyOpenMS. The bound methods (
resolve,checkIdentifications,expectedChannelMZs,getBlacklist) keep their signatures. The new static helpers (blacklistOwner,hasBlacklistOwners,classifyBlacklistOwner, …) are not bound. Python users can still read the owners withgetIntegerDataArrays().
Not repeated here, already on the PR
- CodeRabbit (linked-issues check): the join accepts an unidentified partner without any elution-profile criterion. The head documents this as deliberate (
MS1LabeledWorkflow.cpp:1075-1076), but nobody has answered on the PR, so it still looks open at this head.
Two cases I could not settle (questions, not findings)
I could not build a realistic input for either, so please judge whether they can happen:
- One heavy partial spanning two light partials (
MS1LabeledWorkflow.cpp:1186,:1263). Suppose FeatureFinderMultiplex splits an identified light channel into two partials L1 and L2, and finds one heavy partial H that spans both. The join gives H to L1 (taken), re-measured as R × I(L1). L2's heavy dummy then sees H's peaks as owned by the same peptide and becomes NaN. So the summed heavy misses L2's share. - Owners in the middle are not kept (
MultiplexFiltering.cpp:380-395,provisionalOwners). Only the first and the last writer of a peak are recorded. If both of those multiplets are dropped and one in the middle is reported, the peak looks like an orphan, and the re-quantification may use it. This needs three patterns on one peak.
Tests
-
Good. Every new behaviour has a test that fails without it.
- Class tests assert concrete owner ids: light, heavy, orphan, and the peaks of a dropped pattern with
rt_band, for both profile and centroided input. They also cover thread determinism of the owners, classification, the two-sided lookup, the K+R pattern choice, andexpectedChannelMZs. - TOPP fixtures 8–15 and MultiplexResolver_5 compare outputs and pin the log counts. MultiplexResolver_5 has different expected outputs with and without owners.
- Class tests assert concrete owner ids: light, heavy, orphan, and the peaks of a dropped pattern with
-
Gap: FAIMS. None of the new CV-dependent code is exercised, and there is no MS1LabeledWorkflow FAIMS TOPP test at all. The untested code:
- the join's
compensationVoltage_(channel) != cvcheck; - the CV match in
blacklistSpectrum_; - the targeted
candidate.cv; - owner arrays that come from separate FeatureFinderMultiplex runs per CV.
A small fixture would cover it: take
MS1LabeledWorkflow_8_input.mzMLand give it two CVs, with the heavy partial only at the second CV (FAIMS_CVmeta value or drift time withFAIMS_COMPENSATION_VOLTAGE). Then assert that the join log reports0 partial multiplet(s) were found…and that the light multiplet's heavy channel is not taken from the other CV. - the join's
Measurements
-
Real data: yes, and plenty.
- PXD022659: three DDA runs, with before/after numbers for each component.
- A 7-point dilution series with known ratios.
- A comparison against MetaMorpheus.
This convincingly backs the ratio claims. The description is also open about targeted values being compressed at ≤ 10 % heavy, which is why that option is off by default.
-
Missing: runtime and memory of the default path.
- The owner bookkeeping runs for every FeatureFinderMultiplex user, not only MS1LabeledWorkflow.
blacklist_owner_adds oneintper centroided peak.blacklist_first_owner_adds one hash-map node per peak reserved by more than one filtered peak. Withrt_band > 0, the next spectrum's filtered peak of the same pattern passes again (the primary-peak and same-trace satellite rules) and re-reserves most of the same peaks. So this map then holds roughly one node per blacklisted peak.
- The join is on by default.
- The only runtime number is for targeted quantification (24:40 vs 24:05 min, 1 thread), and the baseline is not named.
The cheapest convincing measurement:
/usr/bin/time -v(wall time and max RSS) of FeatureFinderMultiplex and MS1LabeledWorkflow on one PXD022659 run, develop against this head, with defaults, on 1 and 8 threads, once with the defaultrt_band 0and once with-algorithm:rt_band 5. - The owner bookkeeping runs for every FeatureFinderMultiplex user, not only MS1LabeledWorkflow.
-
No FAIMS data was measured. Together with the missing test above, the CV handling of the new code is unverified.
Generated by Claude Code
… owners and targeted quantification per CV) MS1LabeledWorkflow_19 is fixture 8 acquired at two FAIMS compensation voltages (-45 V and -60 V, one MS1 spectrum per CV at every RT, both with the same RT), with the identifications at -45 V. A peptide's heavy channel at -60 V is not joined to its light partial multiplet at -45 V, the missing channels at -45 V are re-quantified from the -45 V spectra only and not vetoed or skipped because of peaks reserved at -60 V, and the targeted quantification measures at the CV of the identification. The samecv input (the same peaks with two heavy channels at -45 V) is the positive control: the join then gives fixture 8's values and the targeted quantification measures the heavy channel. Eight tests: _19_faims_split (+_out1), _19_faims_owners, _19_faims_samecv (+_out1), _19_faims_targeted (+_out1), _19_faims_samecv_targeted. Every test fails for at least one scratch mutant that drops a CV check: the join candidate CV check, the CV match of the blacklist spectrum lookup, the CV filters of the re-quantification and of the targeted measurement, the candidate's CV, and both CV checks of MultiplexResolverAlgorithm (owner check and plain blacklist check). The inputs were generated from fixture 8's peaks by a stand-alone script that is not part of the repository. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…Workflow: limits of blacklist owners and channel joins Only the first and the last filtered peak that reserved a peak are recorded: a reported multiplet that reserved it in between loses it when the clusters of both are dropped, and the peak then counts as reserved by no reported feature. That needs at least three writers of one peak, in practice only with algorithm:rt_band > 0. Stated at MultiplexFiltering::getBlacklistOwners() and applyBlacklistEntries_(), in the provisionalOwners() comment, in FeatureFinderMultiplexAlgorithm::getBlacklist() (whose rule for peaks reserved by several patterns is corrected: the first one if its multiplet was reported, else the last one) and briefly in the description of algorithm:use_blacklist_owners. joinChannelsOfIdentifiedPeptides_: a partner is joined to one partial multiplet only; another identified partial multiplet of the same channels that it spans keeps its own multiplet, in which the partner's channel is not quantifiable, so the summed channel abundances miss the partner channel's share of it (or, if the partner was the reference, count its share of the identified channels twice). No behaviour change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…klist owners compactly
The owner bookkeeping of the blacklist cost memory in proportion to the number of reserved peaks, which grows
strongly with algorithm:rt_band > 0 (a pattern reserves its mass traces over the RT band, so many peaks are
reserved several times):
- MultiplexFiltering: the first owner of a peak reserved by more than one filtered peak was kept in an
unordered_map (one node per such peak, plus a hash lookup on every overwrite). blacklist_owner_ now encodes
the owners itself: -1 not reserved, >= 0 the only filtered peak that reserved the peak, <= -2 the index
(-2 - value) of a record {first, first_value, last} in blacklist_owner_records_. The record is created when
another filtered peak reserves the peak for the first time, so the first owner and its value are the same as
with the map; later writers only update record.last. O(1) per write, no hash map.
- filtered_peaks_ and BlacklistWriter store the peak index as unsigned instead of size_t (BlacklistWriter
shrinks from 24 to 12 bytes). Owners and records are indexed by int, so applyBlacklistEntries_() throws
Exception::InvalidSize before the filtered peaks, or the records, would exceed INT_MAX (one check per
filtered peak; documented).
- New getBlacklistOwners(Size spectrum_index) returns the owners of one spectrum. FeatureFinderMultiplexAlgorithm
reads them spectrum by spectrum after generating the maps (centroided and profile branch), instead of holding
a full copy of all owners (getBlacklistOwners()) during clustering and map generation. getBlacklistOwners()
stays as a convenience for the class test.
What is recorded and reported does not change: only the first and the last writer of a peak, as documented.
Outputs are unchanged: on an RT slice (25-37 min, MS1 only) of PXD022659 run 099 with the FeatureFinderMultiplex
parameters of the runtime measurement plus -test -out_blacklist, featureXML, consensusXML and the blacklist
mzML (including owner_unique_id_high/low) are byte-identical to before at rt_band 0 and 5, and so are the logs
apart from timings. Peak RSS on that slice (1 thread, without -out_blacklist as in the runtime measurement):
rt_band 0: develop 197.3, before 213.6, now 206.1 MiB; rt_band 5: develop 241.0, before 288.3, now 259.5 MiB.
MultiplexFilteringCentroided_test additionally checks that getBlacklistOwners(Size) matches
getBlacklistOwners() and throws for an index past the last spectrum.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
… of a peak MultiplexFilteringCentroided_test gets a section that reserves peaks of two spectra by hand (applyBlacklistEntries_() through a derived tester) for three filtered peaks A, B and C, and checks getBlacklistOwners() against hand-computed owners: a single writer is first and last owner; A rewriting its own peak adds no record, and the mass trace it leaves is the one kept for the first owner; of three writers, A (first) and C (last) are kept and B is dropped; a second record in the second spectrum; the number of records after each writer; getBlacklistOwners(Size) and its IndexOverflow; alignment with getBlacklist() across a white peak. Every expected writer has a nonzero mass trace, so none of them equals a value-initialized BlacklistWriter. A list of the wrong size fails its size check and skips only the checks of its entries, not the independent checks after it. It replaces the check in the threads section that compared getBlacklistOwners(s) with getBlacklistOwners()[s], which could not fail since the latter is built from the former. MultiplexFiltering.h: the doc of applyBlacklistEntries_() put the last owner in blacklist_owner_; once a peak has a record, the record holds it. Each of these mutants of MultiplexFiltering.cpp fails the new section: the record's first value taken from the new entry; record.last not updated; a record also on an own rewrite; no records at all; every record addressed as the first one; the first owner's mass trace read from the current value; the per-spectrum owners stopping at the first white peak; record.first set to the new owner. Six of them pass the rest of the test. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…he join's doc joinChannelsOfIdentifiedPeptides_: the one observed case of a partner that spans two identified partial multiplets is a light elution split in m/z because its centroids scatter by more than the detection's m/z tolerance (8.1 ppm between the two partials, tolerance 6 ppm), not a split within that tolerance as the doc said. No behaviour change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
|
Answers to the review, point by point.
1. FAIMS test: fixture 19 (commit 796ecef)Fixture 19 is fixture 8 recorded at two compensation voltages, −45 V and −60 V, with one MS1 spectrum per CV at every RT. The identifications refer to −45 V spectra.
Mutants, each removing one CV check:
2. Runtime and memory of the default path
Max RSS, 1 thread (develop, then the excess over develop)
Wall time vs develop, 1 thread
¹ The workflow is faster than develop only in the filtering step. That step is the same code as in FFM, where develop and this PR match, so this is not a gain from the PR.
3. Q A: one heavy partial spanning two light partials
4. Q B: owners in the middle are not kept
5. CodeRabbit: no elution-profile criterion in the join
6. Description
Generated by Claude Code |
#10783 was squash-merged into develop. The conflicts are the lines this branch changes in #10783's files (MS1LabeledWorkflow.cpp, the three fixture-15 references, src/tests/topp/CMakeLists.txt). They are resolved with #10783's head as the base, so the result differs from develop by exactly this PR's own changes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmabHtbvizd9Prmobpf
…ges natively Conflicts and ports: - QcMLFile.cpp: removed with qcML (#10736). - FeatureFinderAlgorithmMetaboIdent (#10765): with FAIMS, a target without features is kept once (by PeptideRef), without a CV, and only if no CV group found it. Its class test checks that now. - FeatureFinderIdentificationAlgorithm (#10787): the candidates of all CV groups are written together (appendFeatures, annotated with their CV); runOnCandidates post-processes FAIMS candidates per CV, each group with the identification data of the candidates, and erases the features no group keeps with the identifications only they link. - FeatureOverlapFilter::mergeFAIMSFeatures (#10765): features identified as different peptides are not merged (first linked match), and the merged feature takes over the links of the other once per spectrum and run. - MultiplexResolverAlgorithm (#10783): owner-aware blacklist; ownerPeptides() reads the first linked identification, peptideKey() takes the sequence (as AASequence::toString() writes it) instead of a PeptideHit. Develop's new tests build their identifications as identification data. - MS1LabeledWorkflow (#10783): joining separately detected channels and the targeted quantification work on the linked and unassigned identifications; identifications move with MS1LabeledIdentifications::moveIdentifications(). Reference outputs: MS1LabeledWorkflow_2, _11_targeted_mbr, _13_targeted_mbr, ProteomicsLFQ_3 and ProteomicsLFQ_3_seedRT are develop's files with the unassigned peptide identifications in the order this branch writes them (run by run, by query ID); the identifications and all other lines are equal (compared block by block), as before the merge. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B51nRFoHvZuVXD7cT8XZav
Conflicts with #10783 (owner-aware blacklist) resolved by carrying its owner tracking into this branch's restructured code: - MultiplexFiltering::filterSpectrum_(): peaks are still moved into the result; the serial path blacklists before the move with the index the peak gets (result.size()), the parallel path calls applyBlacklistEntries_() after adding the peak (result.size() - 1), as on develop. - FeatureFinderMultiplexAlgorithm: the parallel multiplet construction (buildAndAppendMultiplets/appendMultiplet) now records, per reported cluster, the provisional id of each channel's feature in multiplet_ids, the same ids develop's serial loop recorded, for provisionalOwners(). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbcSsYjLfL6414Qei7
… default, never on a pair the join rejected Measured on PXD039580 (HeLa triple SILAC, 6 runs, ProSE IDs) and PXD003327 (E. coli, runs 1-2-4 and 4-1 with an absent medium channel): - 'all' and 'not_join_rejected' added 1202 and 1176 of 185035 cell ratios on PXD039580; the new ones were as accurate as the re-quantified ones of develop (M/L 92 vs 85 %, H/L 82 vs 81 % within 1.5x), on PXD003327 11 (all within 1.5x of their class median), and no false medium value in the absence control. - The 26 ratios that only 'all' adds come from pairs the join examined and rejected. The join's six-spectra minimum was calibrated for them (#10783), and on fixture 10 such a pair gives H/L 0.46 for a 1:1 peptide, so those pairs stay excluded and the option becomes a plain switch. - With 'false' the output is identical to develop on all 8 runs; run time and memory are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL
…dentified multiplets that can be the peptide (#10988) * [FEATURE,PARAM,TEST] MS1LabeledWorkflow: re-quantify channels vetoed only by unidentified multiplets that can be the peptide A missing channel at whose position the detection reserved peaks for another multiplet is made not quantifiable by the resolver before it is measured. When that other multiplet is unidentified, it is often the missing channel itself, detected on its own, and its peaks are otherwise dropped. The new advanced option -requantify_vetoed (none, not_join_rejected, all; default none for now) measures such a channel with the re-quantification's rules (pattern in at least two spectra, M-1 bound, co-elution check) from those peaks too, if every multiplet reserving peaks in the resolver's check window is unidentified and can be the peptide (same charge and CV, all channels at the peptide's channel m/z, the rule the targeted quantification already uses). A multiplet identified as another peptide or as the same one (quantified itself; #10783 made that foreign to avoid counting it twice) keeps the channel not quantifiable. 'not_join_rejected' also leaves channels whose occupant the join examined and rejected (fewer than six paired spectra), as on synthetic data a rejected pair gives a wrong ratio (fixture 10: H/L 0.46 for a 1:1 peptide). - MultiplexResolverAlgorithm::reservingOwners() returns the owners in the check window; isReservedByOther_() uses it, unchanged in behaviour. - The may-be-the-peptide check of the targeted quantification becomes mayBePeptide_() and unidentifiedChannels_(), shared by both paths. - joinChannelsOfIdentifiedPeptides_() reports the pairs it rejected. - With match_between_runs, an unidentified multiplet kept for linking whose peaks gave such a value is removed, as for the targeted quantification. Tests: class test of reservingOwners(); TOPP tests on fixtures 8 (without the join, 'all' gives the join's H/L) and 10 (not_join_rejected vs all). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL * [PARAM,TEST] MS1LabeledWorkflow: -requantify_vetoed true/false, on by default, never on a pair the join rejected Measured on PXD039580 (HeLa triple SILAC, 6 runs, ProSE IDs) and PXD003327 (E. coli, runs 1-2-4 and 4-1 with an absent medium channel): - 'all' and 'not_join_rejected' added 1202 and 1176 of 185035 cell ratios on PXD039580; the new ones were as accurate as the re-quantified ones of develop (M/L 92 vs 85 %, H/L 82 vs 81 % within 1.5x), on PXD003327 11 (all within 1.5x of their class median), and no false medium value in the absence control. - The 26 ratios that only 'all' adds come from pairs the join examined and rejected. The join's six-spectra minimum was calibrated for them (#10783), and on fixture 10 such a pair gives H/L 0.46 for a 1:1 peptide, so those pairs stay excluded and the option becomes a plain switch. - With 'false' the output is identical to develop on all 8 runs; run time and memory are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL * [FIX,TEST] MS1LabeledWorkflow: one vetoed channel per unidentified signal in -requantify_vetoed Review finding: the values of vetoed channels were applied one multiplet at a time, so two identified multiplets of one peptide that the detection found separately (e.g. the light and the medium channel, without the join) could both measure their missing heavy channel from the same unidentified heavy multiplet's peaks. In a run, both features carry the same peptide identity, and the protein and peptide abundances would add the shared signal twice. The values are now collected first and applied afterwards: a value that read the reserved peaks of an unidentified multiplet's channel that another vetoed channel's value read as well is dropped, and that channel stays not quantifiable, as the resolver treats a channel on another multiplet of the same peptide. The log line counts these channels. Test: MS1LabeledWorkflow_24, a synthetic triple SILAC run (generator committed) with LVNELTEFAK detected as three separate channels, the light and the medium one identified. Without the join, both heavy channels stay not quantifiable (before: two heavy values of the same signal); with the join, the three channels form one multiplet. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL * [FIX] MS1LabeledWorkflow: read the re-quantified channel list with toIntList() (MSVC) MSVC rejects constructing an IntList from a DataValue (ambiguous vector constructor) in the code that applies the values of vetoed channels. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL * [FIX,TEST] MS1LabeledWorkflow -requantify_vetoed: use only the unidentified multiplet's channel at the missing channel's m/z; targeted quantification does not read those peaks again From the CodeRabbit review: - A vetoed channel could use the reserved peaks of every channel of an unidentified multiplet that can be the peptide, including another channel's isotopes at its position, e.g. a light-only multiplet's M+4/M+5 read as the Lys4 channel's M0/M+1 (5 ppm apart at m/z 1166). Now only that multiplet's channel at the missing channel's m/z (detection tolerance) may be read. If none of the multiplets has a channel there, the channel is not measured; the log counts it as "on another channel's isotopes of an unidentified multiplet" (new VetoedChannel_::OTHER_CHANNEL). - The targeted quantification treats the reserved peaks of an unidentified multiplet's channel that a re-quantified channel already read as occupied, so that one signal is not counted for two (isobaric) peptides. Test: MS1LabeledWorkflow_26 (generator committed), SVEDLAFGNYQGEDVTALFEK 1:0:1 with light and heavy detected separately, heavy identified, medium absent, without the join: the light is measured from the light multiplet (L = H) and the medium stays not quantifiable. Before, the medium was measured from the light M+4/M+5, and both values were then dropped as reading the same multiplet's peaks. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL --------- Co-authored-by: Claude <[email protected]>
…t only if other channels' isotopes are half of it; reference from two spectra where none gives three (#10997) * [FEATURE,TEST] MS1LabeledWorkflow targeted quantification: leave a peak out only if other channels' isotopes are half of it; a reference from two spectra where no identification gives one from three Two thresholds of the targeted quantification (#10783), neither calibrated on data so far: - A channel's peak that holds an unresolved isotope of a lower channel (e.g. the light M+4 in a Lys4 or Dimethyl4 channel) is now left out only if that isotope's estimated part is at least half of the peak (was 20 %); below that the part is subtracted, as it already was below 20 %. The bound stays because it is the only guard against an unrelated peak at a lower channel's m/z, taken for that channel, whose "isotopes" would take away the channel's peak (fixture 15, SVEDLAFGNYQGEDVTALR: the heavy would become absent). The 20 % rule mostly hit Lys4 channels under a light channel several times stronger (PXD039580 Mix1, L:M = 70:15), whose medium M0 holds 20-50 % light M+4. - The identified channel (the reference) still needs its first two isotopes, without a strong peak one isotope below, in three spectra. An identification that gets no feature that way, and lies in no feature measured from another identification of its peptide, is then measured with two (min_pattern_spectra_, as many as every channel measured against the reference needs). Lowering the minimum to two in one pass let a weak identification that comes first in RT take the peptide's feature from a later, better one: on PXD039580 224 ratios were lost that way (e.g. SGLSSPIYIDLR: an Arg10 identification measured from two spectra instead of the Arg6 one, without a light value). Tests: - Fixture 15: in each of its three references exactly one value changes: TALFEQLSVEDLAFGNYQGDR 1:2:1, whose heavy M0 holds 26 % medium M+4, gets H/L 1.000 (light and medium identification) and 1.011 (heavy identification) instead of not quantifiable. Comments and log regexes updated. - New fixture 25 (generator committed), triple SILAC Lys4: - a medium with 30 % light M+4 is measured (M/L 0.370 for 1/2.7), one with 65 % stays not quantifiable; - a weak light identification with its first two isotopes in two spectra is quantified (M/L, H/L 2.000); - YVNDLAGHEK, identified in its weak medium 3 s before the apex and in its light 2 s after it: the light identification gives the feature (L 4.59e7; a one-pass minimum of two gives the medium one's, L 6.97e6). It fails with develop, with the one-pass version, and with the mutants threshold 0.25, threshold 0.7 and three reference spectra only. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL * [FIX] MS1LabeledWorkflow: do not capture a structured binding in the targeted measuring lambda (clang with OpenMP) clang rejects capturing a structured binding in a lambda when OpenMP is enabled ("capturing a structured binding is not yet supported in OpenMP"); the group is now a plain reference. Checked with clang++-18 -fopenmp -fsyntax-only, which reproduces the CI error before and passes after. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL * [FIX,TEST] MS1LabeledWorkflow targeted quantification: a reference from two spectra ranks last and cannot report a channel absent Review of the two-pass reference minimum: - One signal, one peptide: a peak measured from fewer reference spectra (second pass) now ranks after all others, so an identification with a better score but a reference from two spectra cannot take the signal from a peak measured from more (e.g. isomers, one identified in a weak channel). - Next to such a reference a channel without a peak is not quantifiable instead of absent: a channel seen in two spectra only cannot tell a weaker channel's absence. On PXD039580 (every channel at least 15 %) the second pass had raised the absent targeted channels from 9,346 to 11,748; ratios do not change, since a ratio needs both channels > 0, but the zeros entered the summed abundances. - Only identifications that failed for the reference minimum alone (their identified channel has its first two isotopes in two spectra) are measured again (new TargetedOutcome_::FEW_REFERENCE_SPECTRA), not every one without a peak. - Help text reflowed. Fixture 25 gains SAGLDFVEEK 1:0:0 (weak light, medium and heavy not quantifiable instead of 0) and the isomers ADLTVEFGNK (light, PEP 1e-4, weak) / DALTVEFGNK (heavy, PEP 1e-3, strong) on one signal (the heavy identification's peak is kept: H/L 6.0, L 1.23e7 instead of 1.74e6). The test fails with develop and with the previous head. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL * [FIX,TEST] MS1LabeledWorkflow targeted quantification: a window of two spectra reaches the second pass From the CodeRabbit review: the early guard returned NO_SIGNAL for a window with fewer spectra than the first pass's reference minimum (3), so a window of exactly two spectra never became FEW_REFERENCE_SPECTRA and was never measured with two. The guard now uses min_pattern_spectra_ and leaves the decision to the clean-spectrum check. Practically only a run edge or a very sparse MS1 acquisition leaves two spectra within +/- 'algorithm:rt_typical'. Fixture 25 gains GSAEVTLDFK 1:1:1 in the two spectra at 700 and 701 s only: its light is measured (before: not quantified for want of a clean elution peak), medium and heavy not quantifiable. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL * [FIX,TEST] MS1LabeledWorkflow targeted quantification: co-elution needs three spectra; fixture 25 regex and scan references From the CodeRabbit review of 4e0bca9: - A channel measured against a reference counts as co-eluting only over at least three spectra of the elution peak. With two, the Pearson correlation of the isotope-summed profiles is +/-1 whatever the channel's course, and the second pass (a reference from two spectra) can leave an elution peak of two spectra. With three reference spectra (first pass) the peak always has three, so nothing changes there. - The fixture 25 log regex held a ';', which CMake splits into two alternatives; it is now '..', as in the other tests. - The generator derives each identification's spectrum reference from the list of spectrum times (GSAEVTLDFK at 700.5 s is scan 562, not 601). Fixture 25: GSAEVTLDFK's apex moves to 700.3 s, so its two spectra differ; medium and heavy were accepted at 1:1:1 from the two spectra before and are not quantifiable now. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL * [FIX] MS1LabeledWorkflow targeted quantification: a feature that reports no value replaces no multiplet kept for match between runs The owners of reserved peaks read in the identified channel were recorded whenever the feature was measured, also if it reports no channel (its own intensity not quantifiable, the others not quantifiable or absent). With -match_between_runs true, such a feature removed the unidentified multiplet it read, so that run lost the value linking would have given the multiplet, while the feature has none to give. The reference's owners are now recorded only if some channel is reported, as the comment above the loop and the replacement's documentation say ("so that run gets the targeted value instead"). The documentation now says that the replaced multiplet is the one whose peaks entered one of the feature's values. This is rare: 5 of 16,458 targeted features of one PXD039580 run (8 of 15,053 on develop) report no channel, and the change has an effect only with match between runs, which the benchmark runs do not use. The MS1LabeledWorkflow and Multiplex tests are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL * [FIX,TEST] MS1LabeledWorkflow targeted quantification: co-elution needs the identified channel's peaks in three spectra, not an elution peak of three a3969b2 required the elution peak to span three spectra (last - first >= 2) before another channel's co-elution with the reference is tested. The elution peak is that of the smoothed sum over the channels, trimmed where the smoothed sum is positive, so it reaches past the spectra with signal: a peptide whose peaks lie in two spectra amid spectra every second gets an elution peak of four or more. Its other channels were then correlated over the two spectra with signal and empty ones around them, and that correlation barely depends on their course (e.g. [0, 5, 5, 0] against [0, 9, 1, 0] gives 0.66, above the default 0.5). The condition now counts the spectra of the elution peak in which the identified channel has a peak (its isotope-summed profile, the one the correlation uses, is positive), min_coelution_spectra_ = 3. A first-pass reference has its first two isotopes in at least three spectra, so the first pass is unchanged (as on develop); only a reference from two spectra (second pass) whose channel has no peak in a third spectrum is affected, and its other channels are then not quantifiable. The tested channel's own peaks are not counted: where the reference has a peak and the channel none, the channel's zero is evidence the correlation uses (a weak channel in two of three spectra is accepted on develop's first pass, and stays so). Fixture 25 gets NEFLGSVDYK 1:1:1, all its peaks in the two spectra at 580 and 581 s amid spectra every second: a3969b2 measures its medium and heavy (10 channels measured, 5 not quantifiable), now they are not quantifiable (8 measured, 7 not quantifiable). The help text says that the other channels of a reference with peaks in fewer than three spectra are not quantifiable. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL * [FIX] MS1LabeledWorkflow targeted quantification: record the owners of the identified channel's peaks the reference was taken from If the subtraction of the other channels' isotopes leaves the identified channel too few spectra, its peaks as measured (own_measured) are the reference (own_as_measured). The owners of reserved peaks were still recorded only where the subtracted peak (intensity[own]) is positive; where the subtraction leaves 0, a peak that entered the reference kept its owner unrecorded, so with -match_between_runs true the unidentified multiplet it belongs to stayed next to the targeted feature measured from it. The identified channel's check now uses own_peaks, the peaks the reference was taken from; without the fallback that is intensity[own], so nothing else changes. Like 719c4e5 this has an effect only with match between runs (present on develop). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL * [FIX,TEST] MS1LabeledWorkflow targeted quantification: co-elution needs signal at 10 % of the reference's height in three spectra; only a feature that gives a ratio replaces a multiplet kept for match between runs Review of a939d49 (two medium findings): 1. 0cca54d counted every spectrum in which the identified channel has a peak towards min_coelution_spectra_. One low peak in a third spectrum then satisfied it, and the correlation was still decided by the two spectra of signal: [0, 5, 5, 0.1, 0] against [0, 9, 1, 0, 0] gives 0.70 for a channel whose course is the opposite of the reference's. A spectrum now counts only if the identified channel's isotope-summed profile there is at least 10 % of its maximum (coelution_height_fraction_), i.e. within the elution peak's width at 10 % of its height, the height at which chromatography measures a peak's asymmetry. LVNELTEFAK (M0 in six spectra, M+1 in two) still qualifies. Fixture 25's NEFLGSVDYK gets one low peak (4 % of its apex) at its light M0 at 582 s: a3969b2 and a939d49 both measure its medium and heavy from the two spectra (10 measured, 5 not quantifiable), now they are not quantifiable (8, 7); its features are unchanged. 2. A feature that reports only its identified channel gives no ratio, and withholdIncompleteTargeted_() also takes it out of the abundances (fewer handles than channels). With -match_between_runs true it still recorded the owners of the reference's peaks and so removed the unidentified multiplet it read, losing the value linking would have given it (the case 719c4e5 meant to exclude). The second pass makes such features common (no absent channel, no co-elution from two spectra). Owners are now recorded only if the feature gives a ratio: two channels with a value, one of them > 0. No test covers the match between runs owner changes (719c4e5, a939d49, this one): raising algorithm:peptide_similarity on fixture 11 to make its targeted VLDELTLAR feature report one channel also stops its doublet from being kept for match between runs. Help text and doxygen updated. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL * [FIX] MS1LabeledWorkflow targeted quantification: the 10 % height condition on co-elution applies to references from two spectra only 622474c counted, for every reference, only spectra in which the identified channel's profile reaches 10 % of its maximum. Measured on all four data sets, that also changed develop's first pass, where a reference shows its first two isotopes in three spectra: on PXD039580 it removed 168 of develop's ratios (190 lost instead of 22; the 190 within 1.5x: M/L 85.7 %, H/L 83.5 %), on PXD003327 4 (triplex) and 3 (duplex), with no false value in the absence control either way. Compared with 0cca54d it removed 405 ratios that were 92.6 % (M/L) and 89.1 % (H/L) within 1.5x. The finding it answers is about references from two spectra (second pass), whose third spectrum may hold only a low peak. The condition now applies to them only; a first-pass reference keeps develop's co-elution test (every spectrum with a peak of the identified channel counts, and it has three). Fixture 25's NEFLGSVDYK (second pass) still pins it. A sharp first-pass peak with weak clean tails has the same near-degenerate correlation on develop; changing that is left to a change of its own, since these data show no error it causes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL * [FIX] MS1LabeledWorkflow targeted quantification: a feature replaces a multiplet kept for match between runs if it gives a ratio or abundances 622474c let a targeted feature replace the unidentified multiplet it read if two of its channels have a value and one is > 0. That is not what the ratios and abundances use (CodeRabbit on 6d789c9): MS1LabeledRatioQuantifier forms a channel's ratio against '-ratios:reference_channel' from positive channels only, and withholdIncompleteTargeted_() takes a feature with a not-quantifiable channel out of the abundances. So [NaN, 10, 20] (reference light) or [10, NaN, 0] contribute nothing but replaced the multiplet, while [10, 0, 0] contributes complete abundances. The feature now replaces it if it gives a ratio (its reference channel and another one > 0) or abundances (every channel with a value, one > 0). Only match between runs is affected; documentation updated. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL * [FIX,TEST] MS1LabeledWorkflow targeted quantification: estimate a lower channel's isotopes from that channel's own isotope distribution Review of 77484d8 (medium): a lower channel o's part of a channel's peak was estimated as o's M0 times I_k/I_0 of the identified peptidoform's isotope distribution. A 13C or 15N label replaces natural atoms ((13)C and (15)N are single isotopes in ElementDB), so for a Lys8 or Arg10 identification that distribution has six natural carbons (and two or four natural nitrogens) fewer than the light channel whose M+4/M+5 is subtracted: I_4/I_0 is 15-30 % too small. Under the 20 % bound that left a channel at most 4-8 % too high; under the 50 % bound it is up to 17-31 %, and the value depends on which channel was identified, which the design avoids ("the same data give the same values whichever channel was identified"). Every channel now has its own formula (channelFormulas_()): the identified formula with its own channel's labels replaced by that channel's, from the label sets of MultiplexResolverAlgorithm::expectedChannelMZs() and the labels' diff formulas (ModificationsDB, collected with the labels). isotopes_of_others uses the lower channel's distribution; the identified channel's (unchanged) still checks the isotope pattern. A label without a known composition (a plain mass shift) keeps the identified distribution for all channels, as before. Tests: - New TOPP_MS1LabeledWorkflow_25_heavy_id (MS1LabeledWorkflow_25_heavy_id.idXML, written by the generator): SVEDLAFGNYQGEDVTALFEK identified in its heavy channel gives M/L 0.370 and H/L 0.371, as the light identification; 6d789c9 gives 0.387 and 0.375, which its FuzzyDiff rejects. - Fixture 15: light, medium and heavy identifications now give the same values to 1e-7. The heavy references changed (H/L 1.0015 -> 1.0000 for SVEDLAFGNYQR, 1.011 -> 1.0002 and M/L 2.006 -> 1.9997 for TALFEQLSVEDLAFGNYQGDR, Dimethyl8 having two natural carbons fewer), the light and medium ones by up to 1.4e-4 relative (the Dimethyl4/8 channels' own distributions); every changed element belongs to SVEDLAFGNYQR, SVEDLAFGNYQSVEDLAFGNYR or TALFEQLSVEDLAFGNYQGDR and their protein groups. - Fixture 25's light reference changes by up to 1.2e-4 relative in the heavy channel (the medium's Lys4 distribution). - The version string in the regenerated references is the one the other references carry. ctest -R "MS1LabeledWorkflow|Multiplex": 218/218. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL --------- Co-authored-by: Claude <[email protected]>
Implements the three improvements proposed in #10782 for MS1LabeledWorkflow's identified-to-quantified attrition (PhilRe99/openms_silac_nextflow#6), plus a resolver fix found along the way.
Builds on #10781 (merged).
Changes
1. Blacklist that knows which feature owns a peak
getBlacklistOwners(), also per spectrum).owner_unique_id_high,owner_unique_id_low). They survive mzML (-out_blacklist).algorithm:use_blacklist_owners(default false, so behaviour is unchanged without it):-requantify(default true). The re-quantification then skips only peaks with a foreign owner. It reports NaN instead of 0 when the channel would have a value on the reserved peaks it skipped, for example a triplex medium channel on the light channel's own M+4.2. Join of separately detected channels (
-join_channels, default true)When no spectrum holds the complete pattern, FFM can report a peptide's channels as separate partial multiplets, and the peptide gets no ratio.
algorithm:mz_tolerance.3. Targeted quantification (
-targeted_quantification, default false)This measures identified peptides that have no multiplet in the run.
algorithm:rt_typical), isotopes 0–2 of every channel in the detection's centroided spectra.ElutionPeakDetectionon the summed channels.quantification_method = "targeted".4. Fix:
MultiplexResolverAlgorithm::matchesResidues_A channel only checked the residue kinds labelled in the pattern channel. With
[][Lys8,Arg10], a light K+R peptide therefore matched the Lys8-only pattern, and its partner was placed at +8.014 instead of +18.022 Da. A channel now has to carry one label per residue for every residue kind its sample labels.Real data
PXD022659: three DDA runs of a nominally 1:1 SILAC mix (Lys8/Arg10), with the deposited MetaMorpheus PSMs and the issue's MS1LabeledWorkflow parameters (
knock_out,requantify). A cell is (run, identified peptide form) with L > 0 and H > 0; there are 24,028 identified forms.-join_channels false-targeted_quantification trueDilution series (known ratios)
The same project also holds a HeLa heavy:light dilution series (Pino et al.). I ran one DDA run per point at 70, 50, 30, 10, 5, 1 and 0% heavy, each on its own, with the same MetaMorpheus PSMs and parameters. The table gives the deviation of the median log2 H/L from the expected value (calibrated on the 50% point), over cells with L, H > 0, in log2 units; positive means compressed towards 1:1.
Default path:
What targeted adds:
Where targeted is weak, at ≤ 10% heavy:
Cause, in
pairedIntensity_, which the re-quantification shares. It is the pairing develop's re-quantification already used; develop's re-quantified values are slightly more compressed (10% heavy: +0.57 vs +0.51 in this PR).This is why
-targeted_quantificationstays off by default. The follow-up [FIX] MS1LabeledWorkflow: require the isotope pattern for paired channel intensities #10786 (stacked on this PR) pairs a channel only where its isotope pattern is present, bounds the lower-isotope exemption, and reports a targeted channel as absent only if none of its peaks is seen.Runtime and memory
The default path on one PXD022659 run (C_0-5ug_DDA_099, 21.08 M MS1 peaks), against develop, 1 thread, max RSS from
getrusage:Tests
matchesResidues_,expectedChannelMZs).MS1LabeledWorkflow_7_partial_out.consensusXMLchanges, in the order of one meta value (feature_id). Its only cause is the default join.ctest -R "MS1LabeledWorkflow|Multiplex|ConsensusMap|MzTab|ExperimentalDesign|QPX|StatisticFunctions|ProteomicsLFQ|OpenNuXL|FeatureFinderMultiplex|IMDataConverter"selects pass. These are the class and TOPP tests whose names contain one of these words.Known limitations
Closes #10782.
🤖 Generated with Claude Code
https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ