Repository navigation
[FIX] MS1LabeledWorkflow: require the isotope pattern for paired channel intensities - #10786
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
…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
…nel intensities, absent only without a peak (targeted) A channel measured from peaks paired with a reference (targeted quantification, re-quantification of missing channels, re-measurement of joined channels) is accepted only if its peaks show its isotope pattern in at least two spectra paired with the reference: its first two isotopes, and no peak one isotope below above 30 % of its monoisotopic peak (MultiplexFiltering's zeroth-peak check). Otherwise the channel is not quantifiable (NaN), never 0. The reported value stays the estimate over all paired peaks. A peak one isotope below a channel is taken as the peptide's own only if it is isotope 0 to maxIsotope_() of another channel, as MultiplexFiltering exempts only the isotopes of the pattern. Without that bound, the light M+7 next to the Lys8 channel's M-1 switched the check off, also for the identified channel of the targeted quantification. Targeted quantification: a channel without a value that is not interfered is reported absent (0) only if none of its isotopic peaks is seen within the elution boundaries, otherwise not quantifiable. The default re-quantification keeps its meaning of 0. The join keeps its minimum of six spectra with paired peaks on the count without the pattern requirement. Tests: new fixture MS1LabeledWorkflow_16 (Lys8/Arg10 duplex with targeted and re-quantified cases, plus a Dimethyl case for the exemption). In fixture 15, SVEDLAFGNYQGEDVTALR's medium channel, at whose m/z an unrelated peak sits, is now not quantifiable instead of absent: three regexes change and the three references lose that one element. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…ied channel, correct the -requantify help The bound of the lower-isotope exemption (a peak one isotope below a channel is the peptide's own only if it is isotope M+0 to M+maxIsotope_() of another channel) also applies to the identified channel's clean elution peak in the targeted quantification, but no test covered that half: keeping the old unbounded exemption for the identified channel alone passed every test. New test TOPP_MS1LabeledWorkflow_16_heavy_id (fixture 16 with MS1LabeledWorkflow_16_heavy.idXML): LSDEFVNGAYK is identified in its Lys8 channel, whose peaks are the M+1/M+2 of an unrelated envelope whose M0 lies one isotope below, at the light M+7. It is not quantified for want of a clean elution peak of the identified channel (before: L 1.2e6, H 7.4e5); TNLGEFAVDR's light identification gives the one feature. The test fails with the previous binary and with that mutation, and passes now. -requantify help: the isotope pattern names the exemption (a peak one isotope below that is an isotope of another channel does not count), and the channel is paired with the most intense detected channel instead of "the reference channel", which could be read as 'ratios:reference_channel'. The comment on the join's rejected pairs includes re-measured channels without a value. Correction to the message of the previous commit: in the join, a re-measured channel that does not show its isotope pattern gives no NaN channel; the candidate is not joined, and both partial multiplets stay as they are. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…clarify the absent / not quantifiable wording - Fixture 16: VDTYQLAGNR's heavy channel now shows its isotope pattern paired with a clean light spectrum in exactly one spectrum (one heavy M1 peak added 7 s before the apex; the mzML differs in that spectrum only). It stays not quantifiable with the required two pattern spectra; with one, it would be measured (H/L 0.50), so TOPP_MS1LabeledWorkflow_16_targeted now pins min_pattern_spectra_. No regex or reference changes. - -requantify help and class doc: a re-quantified channel is absent (0) only if its first two isotopic traces are not seen together in two spectra; only otherwise is it not quantifiable for lack of its isotope pattern (or because those traces lie only on reserved peaks). The previous wording also put the absent case under the not-quantifiable clause. - Class doc: peaks reserved by another multiplet make a channel not quantifiable without measuring it (not "only" cause of NaN). - Final NaN log line: "the channel's peaks" instead of the ambiguous "its peaks". Correction to the previous commit's message: in the join, a re-measured channel without a value (e.g. without its isotope pattern) gives no NaN channel; the candidate concerned (whose channel failed, or against whose channel the target's failed) is not joined to this target, and the target is joined to its remaining candidates if their re-measurement passes, otherwise it stays as it is. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…ed paired-spectra count in the join The join re-measures a candidate's channel (or the target's) with the shared pattern gate, but no test covered it: joining a channel that fails the gate with its ungated value, or counting min_join_paired_spectra_ on the pattern spectra instead of all paired spectra, passed every test. New fixture MS1LabeledWorkflow_17 (synthetic SILAC duplex, light identifications) and test TOPP_MS1LabeledWorkflow_17_join (+ _out1): - AVFDNLGTEYK, light only: an unrelated envelope one isotope below the heavy channel co-elutes with the light one, and a signal at the heavy m/z right after it is the join candidate. The re-measured heavy channel has 14 paired spectra but no pattern spectrum (its peaks there are the envelope's M+1 and M+2): not joined (before: joined, H/L 1.19 from the envelope). - TFGDNLVSAER 1:0.063, channels alternating so that each is detected on its own: the heavy channel has 9 paired spectra, 3 of them with its pattern: joined, H/L 0.063. Counting only the pattern spectra (3 < 6) rejects it. No change to the program; all other tests and references are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…ten lines, word the lower-isotope rule as implemented - -targeted_quantification: re-flow the help to nine lines plus 'false:' (it had grown to eleven, and TOPPBase shows at most ten per option, so --help replaced the lines on which identifications are not measured by "..."); the text is unchanged. - -join_channels: name the second reason a candidate is not joined, a re-measured channel that is absent or not quantifiable (e.g. its peaks do not show its isotope pattern), as the log line and the doxygen already do. - The "not quantifiable" log line of the re-quantification, the docs of lower_isotope_fraction_, min_pattern_spectra_ and pairedIntensity_, and the fixture 16 comment: a pattern spectrum has no peak one isotope lower that exceeds 30 % of the channel's monoisotopic peak (as the -requantify help says), not "no stronger envelope one isotope below". No change in behaviour or quantitative output; the 16_requant regex stops before the changed part of the log line. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…xemption and the targeted absent rule on all isotopes read - The exemption of a peak one isotope below a channel (an isotope M+k of another channel) holds for 0 <= k <= n, n + 1 the maximum of 'algorithm:isotopes_per_peptide'. Only k = 3 (exempt) and k = 7 (not exempt) were tested, so a bound of k < n, or one hard-coded from 3 to 6, passed. The Dimethyl case of fixture 16 (medium M-1 on the light M+3, k = 3) now also runs with isotopes_per_peptide 3:4 (n = 3: still exempt, the medium is measured) and 3:3 (n = 2: not exempt, the medium is not quantifiable). - In targeted quantification a channel is absent (0) only if none of its isotopic peaks read (M+0 to M+2) is seen within the elution peak. Only M0 was tested. Fixture 16 gets two light-identified peptides (new MS1LabeledWorkflow_16_no_mono.idXML) whose heavy channel shows an unrelated envelope on its M+1/M+2, resp. M+2/M+3, and nothing at its M0: both heavy channels are not quantifiable (they were reported as absent). - The added peaks lie at m/z 672-693, RT 122-178, apart from the other cases; the FASTA gets the two proteins. All other outputs of fixtures 16 and 17 are unchanged (only the whitelisted spectra_data line differs); no existing reference or regular expression changed. 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 4e8bd11 against claude/issue-10782-silac-coverage (81788e3), so only this PR's change on top of #10783. Please double-check anything before acting on it. A maintainer will follow up.
I could not build OpenMS or run the TOPP tests here, because the vcpkg sources and Arrow ≥ 24 are not available. Instead, I copied lowerIsChannel_, pairedIntensity_ and the targeted 0/NaN bookkeeping into small standalone g++ programs and used them to check the isotope bound, the boundaries of the gate and the finding below.
Verdict: no high-priority issue. The pattern gate, the lower-isotope bound and the join change do what the description says. I found one medium-priority problem: the new targeted rule "absent only without a peak" is not applied to M+2 peaks that belong to another detected peptide.
Checked and found sound:
- The gate (
pairedIntensity_,MS1LabeledWorkflow.cpp:1671).- A pattern spectrum needs the first two isotopes, at least one isotope paired with the reference, and a lower peak no larger than 0.3 × M0. The test is "exceeds", as in
MultiplexFiltering::checkForSignificantPeak_. - A value is accepted with 2 or more pattern spectra (
:1742). - The sums are unchanged, so every value that is kept is identical to before, which matches "bit-identical".
- In the harness, a lower peak of exactly 0.3 × M0 passes, 1 pattern spectrum gives NaN and 2 give a value.
- A pattern spectrum needs the first two isotopes, at least one isotope paired with the reference, and a lower peak no larger than 0.3 × M0. The test is "exceeds", as in
- The bound (
:1610).k <= maxIsotope_()matches the satellites that MultiplexFiltering exempts in its zeroth-peak check (isotopes0 .. isotopes_per_peptide_max_ - 1,MultiplexFiltering.cpp:167,:246-253).- Harness results at 6 ppm, z = 1–4:
- Never exempt with the default 3:6: Lys8 (k = 7), Arg10 (k = 9), and two-label Dimethyl8 against light (k = 7).
- Exempt with 3:6: Lys4 and Dimethyl4 (k = 3), Arg6/Lys6 (k = 5, residual 0).
- Arg6 loses the exemption at 3:5 or lower.
lowerPeak_reads in the same 2 × tolerance window thatlowerIsChannel_checks. So an isotope of another channel that falls outside the exemption window is never read as the lower peak either.
- Status mapping.
- The re-quantification gives NaN only for a channel that has a value but fails the gate. It still gives 0 only when the first two isotopes are not seen together in two spectra.
- The log counters split the cases without overlap.
- NaN handles are removed before export (
:2728), and NaN targeted channels are never inserted (:2460), so no NaN reaches consensusXML, mzTab or QPX. - The join rejects NaN (
:1247), so a joined multiplet never carries a gated channel. The minimum of 6 spectra still counts all paired spectra (result.paired).
- The exemption list. In the re-quantification it includes the resolver's dummies at their expected m/z (
MultiplexResolverAlgorithm.cpp:566). In the join it covers only the channels present, which the description lists as a known limitation (it cannot occur in duplex). - Expected-output churn in fixture 15 is explained.
- Each of the three references loses exactly one element: the
it="0.0"medium of SVEDLAFGNYQGEDVTALR. - The new
seenrule turns that channel from 0 into NaN, because the unrelated peak sits on its M0. - The regex counts move by one, from absent to not quantifiable.
- Each of the three references loses exactly one element: the
- 0 vs NaN for the same evidence. When only the M0 is seen, the re-quantification still reports 0 (DGVNAYLTEFR) and targeted mode reports NaN (AFDNLVGSTK). This is deliberate and documented.
- CI.
build-and-test (ubuntu-24.04-arm, g++)is green. The other build-and-test jobs were still running when I looked.
Medium: targeted mode reports a channel as absent when its only peak is another detected peptide's peak at its M+2
Where: measureTargeted_ reads M+0 to M+2 of every channel.
- A peak that belongs to another peptide is set to 0 in
intensity[c](MS1LabeledWorkflow.cpp:1971). - It is recorded in
reserved[c]only for the first two isotopes (:1973,if (other && k < 2)). - The new rule takes
seenfromintensity[c]andinterferedfromreserved[c](:2114-2117). So such a peak at M+2 counts as neither.
The comment at :2111-2113 assumes the left-out peaks are covered by reserved. That held for #10783's M0/M1 rule. It no longer holds now that seen also reads M+2.
Scenario: a light-identified peptide whose heavy channel shows nothing at its M0 and M1 within the elution peak, while another envelope sits on the heavy's M+2 (the LGYDVFNTSEAR case of _16_no_mono).
- Envelope not detected: NaN.
_16_no_monopins this. - Envelope detected as another peptide's multiplet: 0 (absent). The same applies to any reserved peak when the blacklist has no owners, because
occupiedthen returns true for every reserved peak (:2353).
The channel shows the same evidence in both cases but gets opposite statuses. The 0 contradicts the documented rule "absent (0) only if none of its isotopic peaks is seen within the boundaries". Before this PR, both cases gave 0. The difference comes from widening seen to M+2 without widening reserved. The case is narrow: it needs targeted mode, which is off by default, and empty M0/M1 positions.
My standalone copy of this bookkeeping confirms it:
- M+2 peak not reserved: NaN.
- The same M+2 peak reserved by another peptide: 0.
- The same peak at M+1, reserved: NaN.
Suggested mitigation: record left-out peaks for every isotope read. reserved is used only in the interfered check (:2114), so nothing else changes. Sketch, not compiled:
if (other) { reserved[c].back() = true; } // any isotope read: a left-out peak means the channel's absence cannot be toldAlso update the comment on reserved (:1933). If 0 is the intended answer when M0 and M1 are empty, the other consistent option is to drop M+2 from seen. That would change the _16_no_mono expectation, so the two cases need to agree one way or the other. A _16_no_mono variant where the M+2 envelope is detected and identified as another peptide would pin whichever rule you choose.
Tests
- Good:
- Two new synthetic fixtures with 11 new tests, roughly one per rule. The CMake comments give the "was" value for each case.
- The regexes I checked fail on #10783's logic as the description says. For example,
_16_no_monoexpects "0 absent, 2 not quantifiable", and_16_heavy_idexpects the heavy identification to be dropped. - The
3:4/3:3pair pins the bound exactly: ak < nor ak <= n + 1mutant fails one of them.
- Gap: the exemption is never exercised in the default path.
- It is tested only in targeted mode (
_16_dimethyl*). Every re-quantification and join test uses Lys8/Arg10, where the exemption never applies. - For Lys4, Dimethyl4 or Arg6 data, the default re-quantification now depends on it. With averagine, the light M+3 is 0.16 of the light M0 at 1.5 kDa and 0.32 at 2 kDa. So from about L:M 2:1 (1.5 kDa) or 1:1 (2 kDa) on, the light M+3 exceeds 30 % of the medium M0. Without the exemption, the medium would then be NaN. The same happens if the
channel_mzspassed inrequantifyMissingChannels_ever lost the light. - Suggested test: default settings with
[Dimethyl0][Dimethyl4]on a 1:0.2 duplex. The light should be detected (M0–M3 recorded) and the medium missed by the detection (e.g. only its M0/M1 recorded). Expect the medium re-quantified at M/L 0.2 and no "not quantifiable: their peaks do not show the channel's isotope pattern" line.
- It is tested only in targeted mode (
- Gap from the finding above: the detected-interferer variant of
_16_no_mono.
Measurements
Yes, on real data, and thorough for Lys8/Arg10:
- the PXD022659 dilution series (7 points × 3 runs) and the 1:1 three-run set, with before/after numbers per point;
- false values at 0 % heavy, and the coverage cost in both modes;
- runtime and memory (CPU time ratio 1.00, ±0.5 % memory).
Missing:
- Labels where the exemption applies (Lys4, Dimethyl, Arg6). Every measurement uses Lys8/Arg10, where the bound only removes the exemption. The cheapest check is one Dimethyl or Lys4 run with default settings, before and after. The new log line counts the re-quantified channels that turn NaN, and the cells in the output show what is lost.
- Correct 0s in targeted mode.
- Under the new rule, a channel is absent only if no peak is seen at its M0–M2 anywhere in the elution peak. Reported 0s at 70–30 % heavy fell to 2–5 % of their former count.
- The 0 % heavy runs would show what this costs in true absences: the number of targeted heavy channels reported as 0 vs NaN in those three runs, #10783 vs this PR.
- False 0s in the default re-quantification at 1:1, counted the same way as targeted mode's 538 → 28 (optional). The re-quantification still reports 0 when only the M0 is seen, so this count would show whether the default path needs the same rule.
Generated by Claude Code
… targeted channel not quantifiable The targeted quantification leaves out the peaks of other peptides or channels (on another multiplet, reserved by another feature, or mostly another channel's isotope), but recorded such a peak as occupying the channel only for its M0 and M1. A left-out peak at M+2, e.g. a peak of another peptide's detected multiplet, therefore counted neither as seen nor as occupying the channel, which was reported absent (0), while the same peak of an undetected envelope made it not quantifiable. The peak is now recorded for every isotope read (M+0 to M+2): a channel is absent only if none of these positions holds a peak, its own or another's, within the elution peak. Tests, on a new synthetic fixture MS1LabeledWorkflow_18 (its cases need detected features, which would shift the unique ids in fixture 16's reference): - TOPP_MS1LabeledWorkflow_18_occupied: a targeted heavy channel with nothing at its M0/M1 whose M+2 is the light M0 of a detected, identified duplex of another peptide: not quantifiable (was absent). - TOPP_MS1LabeledWorkflow_18_dimethyl_requant: default re-quantification of a [Dimethyl0][Dimethyl4] 1:0.2 duplex whose medium was missed and whose M-1 is the light M+3 (0.66 x the medium M0): the exemption of another channel's isotope keeps the medium's pattern, M/L 0.2, and no channel is reported not quantifiable for want of its pattern. Both with a reference consensusXML. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
|
Answers to the remaining items of the initial review (the M+2 finding is answered in its thread). Test: the exemption in the default pathNew
Real data with labels where the exemption applies
Targeted mode: true 0s at 0 % heavyHeavy channels of light-identified targeted features in the three pure-light runs, mean per run. At 0 % heavy every 0 is correct and every value > 0 is false.
So the rule costs about 7,800 true absences per pure-light run, which become NaN: 90 % → 32 % of these heavies are reported as 0. At 1:1, where a 0 is wrong, false absents go 538 → 27 (C_099). This is the price of "absent only if nothing is seen at M+0 to M+2". The PR description now states it. Default re-quantification: 0s at 1:1 (optional item)
Other updates
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
…ired-intensity-gating 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
…ired-intensity-gating Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Re-quantification isotope-pattern checks src/topp/MS1LabeledWorkflow/MS1LabeledWorkflow.cpp |
Re-quantification tracks paired spectra and spectra meeting the isotope-pattern requirement. Results distinguish pattern failures from absent or reserved-peak channels. |
Channel-join re-measurement src/topp/MS1LabeledWorkflow/MS1LabeledWorkflow.cpp |
Channel joining rejects candidates when re-measurement yields no positive intensity or too few paired spectra. |
Targeted channel classification src/topp/MS1LabeledWorkflow/MS1LabeledWorkflow.cpp |
Targeted quantification checks isotope patterns and lower-isotope interference across channels. It classifies channels with observed signals but failed checks as not quantifiable, rather than absent. |
Workflow regression tests and fixtures src/tests/topp/CMakeLists.txt, src/tests/topp/MS1LabeledWorkflow_15_*_out.consensusXML, src/tests/topp/MS1LabeledWorkflow_16.*, src/tests/topp/MS1LabeledWorkflow_16_*, src/tests/topp/MS1LabeledWorkflow_17.*, src/tests/topp/MS1LabeledWorkflow_17_out.consensusXML, src/tests/topp/MS1LabeledWorkflow_18.*, src/tests/topp/MS1LabeledWorkflow_18_* |
TOPP expectations and workflow fixtures cover isotope-pattern checks, channel classification, re-quantification, and joining behavior. |
Possibly related issues
OpenMS/OpenMS#10782— The issue covers missing SILAC ratios in targeted quantification and channel joining; this PR updates both paths with isotope-pattern checks and revised channel classification.
Possibly related PRs
- OpenMS/OpenMS#10783 — It adds channel joining, targeted quantification, and owner-aware re-quantification in the same workflow paths changed here.
- OpenMS/OpenMS#10781 — It changes upstream multiplex channel detection; this PR adds downstream paired-channel and isotope-pattern checks.
Suggested labels: major
Suggested reviewers: jpfeuffer
Change: Bug fix
Merge Risk: 
Minimal · up to 3d608
-
No actionable merge-blocking issue was established; the change is ready to merge after normal checks.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 90.00% which is sufficient. 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 10 functions across 1 files. (16 skipped: 16 unsupported.)
-
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 checks each isotope trace,
Two paired scans must show the pattern in place.
A missing peak is not the same
As a signal that fails the naming game.
The channels sort, the tests agree,
And carrots wait for QA’s decree.
#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
… MBR linking; report targeted ratio counts Targeted features took part in the ID-based alignment and in linking. On PXD022659 that widened the alignment's maximum difference (147 -> 545 s at 50 % heavy) and with it the RT tolerance of the linking, and a targeted feature could draw an unidentified multiplet kept for match between runs into its own linked feature, possibly one of another peptide ~10 min away. With -match_between_runs this changed or lost about 1 % of the peptide ratios reported without targeted quantification. - alignAndLink_(): targeted features are split off before the alignment, transformed with the transformations of the detected multiplets, and linked among themselves after those have been linked. Alignment, linking and match between runs are therefore those without targeted quantification. The documented exception remains: a targeted feature replaces the kept multiplet it is measured from. - The promotion of an unidentified multiplet through a targeted identification can no longer occur; TOPP_MS1LabeledWorkflow_11_targeted_ mbr_promoted now expects 3 targeted peptide ratios (run B has no VLDELTLAR value, as without targeted quantification). - Targeted ratio counts reach the outputs (only when targeted quantification measured something, so other outputs do not change): MS1Label:peptide_ratio_targeted_count on the features (mzTab opt_global column), the protein-group array fraction_group_level_ratio_targeted_count and the QPX pg cv_param ratio_targeted_count. New tests check the QPX value for the one-protein fixture (0 with min_ratio_count 1, 2 with 2). Merge of develop (#10786): the targeted references of fixtures 16 and 18 change in the two ways this PR documents (normalized ratios by one factor, abundance arrays of groups whose only evidence is a targeted feature with a non-quantifiable channel removed). The other targeted references gain the targeted counts; the MBR/FAIMS ones also their new linking (ratios checked against the old references: unchanged except the promoted case above). All 128 tests selected by ctest -R MS1Labeled pass, as do ProteinGroupArrowExport_test and ConsensusMapArrowExport_test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… tolerance and the identified channel's own 30 % check Synthetic fixtures (isotope centroids at their fine-structure positions): - MS1LabeledWorkflow_22_heavy: fixture 22's spectra with the two targeted peptides identified in their heavy channel. A peak at the heavy M-1 that is never exempt (nine isotopes above the light, beyond M+5) at 0.2 x the heavy M0 keeps the identified channel (L/H 2); at 0.4 x no spectrum is clean and the identification is not quantified. Pins the bound of the identified channel's own clean-spectrum check in targeted mode to 0.2 < t < 0.4; no test reached that check before. - MS1LabeledWorkflow_23 (triple SILAC, re-quantification): an unrelated peak at 0.4 x the M0 of a re-quantified channel in every spectrum. 9 ppm below the heavy M-1 it is read (window of twice the m/z tolerance): heavy not quantifiable. Exactly at the medium M-1 and 9 ppm from the light M+3 position, with no light M+3 centroid, it is not the light M+3 (identity within the tolerance itself, not twice) and not exempt: medium not quantifiable. 15 ppm below the heavy M-1 it is not read: H/L 0.5. Also drops two double blank lines in the MS1LabeledWorkflow tests, and names the baseline of earlier values in the fixture 20-22 comments (the exemption by theoretical position, or no isotope-pattern check). develop (84a5b3f) fails 10 of the 132 MS1LabeledWorkflow tests: 20_requant, 20_targeted, 20_foreign, 21_join_triplex and 23, each with its _out1. 22_heavy passes there (the check predates #10786). Mutants of MS1LabeledWorkflow.cpp, each killed: the old theoretical window, the identity check within twice the tolerance and the old window as an alternative (now also by 23), no exemption, k up to max_isotope + 1, the join's channel list without the missing channels or cleared, the re-quantification's list of detected channels only, a join that ignores the identified multiplet's failed channel, lower_isotope_fraction_ 0.0, 0.1, 0.5 and 0.54, the M-1 read within the tolerance itself (23, 16_dimethyl_isotopes3) or within three times it (23), and the identified channel's own check at 0.0 or 0.5 instead of the bound (22_heavy). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
|
A review after the merge found 8 points. None gives a wrong value: each turns values into NaN (not quantifiable) or is in the docs, the description or the tests. The code, docs and tests are in #10808, which also has the evidence. The description above is corrected. My earlier answer above repeats some of these statements (what was lost, the exemption at work, the 6x); the description holds the corrected version. (M0 is a channel's monoisotopic peak, M+k its k-th isotope, and M−1 the position one isotope below its M0.)
The description also had three older slips, now corrected:
Generated by Claude Code |
…only adds ratios); count ratios from targeted and re-quantified values; co-elution check for weak re-quantified channels (#10802) * [WIP] MS1LabeledWorkflow: targeted values only add ratios; incomplete targeted evidences leave the abundances Work in progress: not compiled or tested yet; the references of the new TOPP tests (MS1LabeledWorkflow_11_one_protein_min1/min2) are still missing, and those of the existing targeted tests are not regenerated. - MS1LabeledRatioQuantifier: evidences of targeted quantification (the runs in the feature's meta value MS1Label:targeted_runs) only stand in where nothing else was measured. A peptide ratio uses them only if the peptide has no other evidence in that fraction group; a protein group ratio only if its other peptide ratios do not reach min_ratio_count; the normalization factors only if a (fraction group, channel) has no other peptide ratio. A ratio reported without targeted quantification therefore stays the same with it. - MS1LabeledWorkflow: after linking, the runs in which targeted quantification measured a multiplet are read from its identifications and recorded in MS1Label:targeted_runs (removed again after the ratios). Targeted evidences with a channel that is not quantifiable are left out of the peptide and protein abundances (taken out before PeptideAndProteinQuant reads the map, given back afterwards). - Without -targeted_quantification nothing changes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmabHtbvizd9Prmobpf * [TEST] MS1LabeledWorkflow: references for targeted values as a fallback Compiled and tested: all 104 tests selected by ctest -R MS1Labeled pass (class tests and TOPP tests). - New references MS1LabeledWorkflow_11_one_protein_min1/min2: PROT_X's ratio is the detected YVNDLAGHEK's alone with a minimum of 1 (count 1; the develop binary gives count 3 with the targeted peptides mixed in), and includes the two targeted peptide ratios with a minimum of 2 (count 3). Its light abundance drops from 2.99e7 to 2.68e7: the two light-only targeted features whose heavy is not quantifiable leave it. Both runs fail with the develop binary (their log lines are missing). - Nine targeted references change, and only in two ways, checked against the outputs of the develop binary built in the same environment (which match the old references up to the whitelisted lines): - normalized ratios (protein groups and peptides), by one factor per (fraction group, channel): the normalization now uses only the peptide ratios measured without targeted quantification. Fixture 12 moves most (factor 1.96 for channel 3), where a targeted H/L of 0.02 had moved the median. - the abundance arrays of protein groups whose only evidence is a targeted feature with a channel that is not quantifiable (fixture 11: PROT_F, PROT_H; 12: PROT_A, PROT_C, PROT_D; 13: PROT_P1, PROT_PM, PROT_PN; 15: PROT_A, PROT_B, PROT_E, PROT_S, PROT_Q). Their ratios stay. No raw ratio, no other abundance and no feature changes. The whitelisted lines (InferenceEngineVersion, spectra_data) are kept from the old references. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmabHtbvizd9Prmobpf * [TEST,DOC] MS1LabeledWorkflow: one expression per log assertion; the targeted fallback is per channel - The PASS_REGULAR_EXPRESSION of MS1LabeledWorkflow_11_one_protein_min1/ min2 contained a ';', which CTest reads as a list separator, so the protein-group count was not checked. It is now '.'. - A peptide ratio uses targeted evidences where the peptide has no other evidence of that channel in that fraction group (as implemented); the class doc, the code comment and the tool doc say so explicitly now. New case in MS1LabeledRatioQuantifier_test: a triplex peptide detected as L/M with its heavy missing and measured by targeted quantification as L/H keeps its detected M/L and gets the targeted H/L. All 104 tests selected by ctest -R MS1Labeled pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmabHtbvizd9Prmobpf * [FIX] MS1LabeledWorkflow: a multiplet identified only by targeted features counts as targeted in all runs With -match_between_runs, an unidentified multiplet of another run can take over the identification of a targeted feature in linking. Its evidence exists only because of targeted quantification, but it counted as detected, entered the normalization and the detected peptide ratios of its protein groups, and could move ratios that are reported without targeted quantification. A multiplet whose identifications are all targeted now counts as targeted in all of its runs. The remaining exception with match between runs is documented in the tool doc and the -targeted_quantification help: a targeted feature that replaces an unidentified multiplet kept for match between runs gives its run the targeted value instead of the one linking would have given the multiplet (fixture 11 with _apex: VLDELTLAR 0.935 instead of 0.962). Tests: - New TOPP test MS1LabeledWorkflow_11_targeted_mbr_promoted (fixture 11 plus MS1LabeledWorkflow_11_apex_noVLDELTLAR.idXML, i.e. _apex without VLDELTLAR): run B's unidentified VLDELTLAR doublet takes over run A's targeted identification. It now counts as targeted (4 targeted peptide ratios instead of 3), and YVNDLAGHEK's normalized ratio in run B stays 1.0 as without -targeted_quantification (1.00015 before this fix). - MS1LabeledRatioQuantifier_test: a (fraction group, channel) with targeted ratios only is normalized by them. All 106 tests selected by ctest -R MS1Labeled pass; no existing reference changes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmabHtbvizd9Prmobpf * [DOC,TEST] MS1LabeledWorkflow: state where match between runs still moves ratios; pin the promoted normalized ratio The PXD022659 benchmark posted on the PR (7 dilution points x 3 runs) confirms that without -match_between_runs no ratio reported without targeted quantification changes with it (0 changed, 0 lost). With match between runs, about 1 % of the peptide ratios still change or are lost, through two mechanisms in linking: the documented replacement of a kept multiplet by the targeted feature measured from it, and a targeted feature drawing an unidentified multiplet of another peptide into its linked feature (which develop does as well). The tool doc and the -targeted_quantification help now state both instead of only the replacement. New test TOPP_MS1LabeledWorkflow_11_targeted_mbr_promoted_normalized checks YVNDLAGHEK's normalized ratios exactly ([1.0, 1.0, 1.0, 1.0]); FuzzyDiff's tolerance accepted the 1.00015 of run B before the fix. It fails on the output without the fix. All 107 tests selected by ctest -R MS1Labeled pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmabHtbvizd9Prmobpf * [FIX] MS1LabeledWorkflow: targeted features stay out of alignment and MBR linking; report targeted ratio counts Targeted features took part in the ID-based alignment and in linking. On PXD022659 that widened the alignment's maximum difference (147 -> 545 s at 50 % heavy) and with it the RT tolerance of the linking, and a targeted feature could draw an unidentified multiplet kept for match between runs into its own linked feature, possibly one of another peptide ~10 min away. With -match_between_runs this changed or lost about 1 % of the peptide ratios reported without targeted quantification. - alignAndLink_(): targeted features are split off before the alignment, transformed with the transformations of the detected multiplets, and linked among themselves after those have been linked. Alignment, linking and match between runs are therefore those without targeted quantification. The documented exception remains: a targeted feature replaces the kept multiplet it is measured from. - The promotion of an unidentified multiplet through a targeted identification can no longer occur; TOPP_MS1LabeledWorkflow_11_targeted_ mbr_promoted now expects 3 targeted peptide ratios (run B has no VLDELTLAR value, as without targeted quantification). - Targeted ratio counts reach the outputs (only when targeted quantification measured something, so other outputs do not change): MS1Label:peptide_ratio_targeted_count on the features (mzTab opt_global column), the protein-group array fraction_group_level_ratio_targeted_count and the QPX pg cv_param ratio_targeted_count. New tests check the QPX value for the one-protein fixture (0 with min_ratio_count 1, 2 with 2). Merge of develop (#10786): the targeted references of fixtures 16 and 18 change in the two ways this PR documents (normalized ratios by one factor, abundance arrays of groups whose only evidence is a targeted feature with a non-quantifiable channel removed). The other targeted references gain the targeted counts; the MBR/FAIMS ones also their new linking (ratios checked against the old references: unchanged except the promoted case above). All 128 tests selected by ctest -R MS1Labeled pass, as do ProteinGroupArrowExport_test and ConsensusMapArrowExport_test. Co-Authored-By: Claude Opus 5.5 <[email protected]> * [FEATURE] MS1LabeledWorkflow: report the ratios resting on re-quantified channels; optional co-elution check for them Re-quantified channels (-requantify, MaxQuant's re-quantify) are measured where the detection found no pattern. On PXD022659 they double the peptide ratios at 10 / 5 % heavy, but are less accurate there than detected ones (80 / 74 % vs 94 / 86 % within 2x) and add 3.7x the false peptide ratios in a pure light sample. - Counts: per peptide ratio the evidences whose channel or reference channel was re-quantified (MS1Label:peptide_ratio_requantified_count on the features, also an mzTab opt_global column), per protein group ratio the peptide ratios all of whose evidences were (fraction_group_level_ratio_requantified_count, QPX pg cv_param ratio_requantified_count). Written only where a channel was re-quantified. The re-quantified channels are recorded on the identifications (which keep their run through linking) and moved to the multiplet after linking, by run name and label like the targeted runs (the columns change when fractions are combined); both records are removed before the output. - -requantify_min_correlation (advanced, default -1 = off): a re-quantified channel whose elution profile (summed isotopic peaks per spectrum) correlates with the reference's by less is not quantifiable. On PXD022659, 0.5 removes 42 % of the false protein ratios at 0 % heavy and 25-40 % of the wrong ones at <= 10 % heavy, but also 2-5 % of the correct ones at 70-30 % heavy, and the abundances get slightly worse; hence off by default. Tests: seven references with re-quantified channels gain the counts (no other change); new TOPP tests check the QPX count and the log line on fixture 7 and the correlation path; a new class-test section pins the counting rules. All 132 tests selected by ctest -R MS1Labeled pass, as do ProteinGroupArrowExport_test and ConsensusMapArrowExport_test. Co-Authored-By: Claude Opus 5.5 <[email protected]> * [FEATURE] MS1LabeledWorkflow: targeted quantification and a co-elution check for weak re-quantified channels by default - -targeted_quantification now defaults to true: its values only add ratios, and the targeted and re-quantified counts let users filter them. - -requantify_min_correlation now defaults to 0.5 and applies to re-quantified channels weaker than -requantify_correlation_ratio (new, default 0.3) times the reference channel only; it is no longer applied when joining channels (those were detected). The elution correlation uses Math::pearsonCorrelationCoefficient, as the targeted quantification does. On PXD022659 (7 points x 3 runs, without match between runs), protein ratios within 2x of the expected H/L, old defaults -> new defaults (wrong ones in brackets): 70 % 2,570 (5) -> 3,817 (11); 30 % 2,694 (16) -> 3,682 (41); 10 % 1,890 (219) -> 1,983 (307); 5 % 1,044 (256) -> 1,094 (243); 1 % 149 (209) -> 163 (173); false protein ratios at 0 % heavy 122 -> 107. With match between runs alike. The weak-only check costs no correct ratio at 70-30 % heavy (checking all re-quantified channels cost 4-5 %); summed abundances are better at 70-30 % heavy and 1-3 points worse at 5-1 %. Runtime +14 % (targeted quantification). Tests: TOPP_MS1LabeledWorkflow_11_targeted now runs with the defaults; the former _11_default test is _11_untargeted with -targeted_quantification false (reference renamed), and the FAIMS split and same-CV tests pin -targeted_quantification false (their point is the join; the targeted FAIMS case has its own test). No reference content changes: the synthetic fixtures co-elute. All 132 tests selected by ctest -R MS1Labeled pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude <[email protected]> Co-authored-by: timosachsenberg <[email protected]>
… tolerance and the identified channel's own 30 % check Synthetic fixtures (isotope centroids at their fine-structure positions): - MS1LabeledWorkflow_22_heavy: fixture 22's spectra with the two targeted peptides identified in their heavy channel. A peak at the heavy M-1 that is never exempt (nine isotopes above the light, beyond M+5) at 0.2 x the heavy M0 keeps the identified channel (L/H 2); at 0.4 x no spectrum is clean and the identification is not quantified. Pins the bound of the identified channel's own clean-spectrum check in targeted mode to 0.2 < t < 0.4; no test reached that check before. - MS1LabeledWorkflow_23 (triple SILAC, re-quantification): an unrelated peak at 0.4 x the M0 of a re-quantified channel in every spectrum. 9 ppm below the heavy M-1 it is read (window of twice the m/z tolerance): heavy not quantifiable. Exactly at the medium M-1 and 9 ppm from the light M+3 position, with no light M+3 centroid, it is not the light M+3 (identity within the tolerance itself, not twice) and not exempt: medium not quantifiable. 15 ppm below the heavy M-1 it is not read: H/L 0.5. Also drops two double blank lines in the MS1LabeledWorkflow tests, and names the baseline of earlier values in the fixture 20-22 comments (the exemption by theoretical position, or no isotope-pattern check). develop (84a5b3f) fails 10 of the 132 MS1LabeledWorkflow tests: 20_requant, 20_targeted, 20_foreign, 21_join_triplex and 23, each with its _out1. 22_heavy passes there (the check predates #10786). Mutants of MS1LabeledWorkflow.cpp, each killed: the old theoretical window, the identity check within twice the tolerance and the old window as an alternative (now also by 23), no exemption, k up to max_isotope + 1, the join's channel list without the missing channels or cleared, the re-quantification's list of detected channels only, a join that ignores the identified multiplet's failed channel, lower_isotope_fraction_ 0.0, 0.1, 0.5 and 0.54, the M-1 read within the tolerance itself (23, 16_dimethyl_isotopes3) or within three times it (23), and the identified channel's own check at 0.0 or 0.5 instead of the bound (22_heavy). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…ges natively MS1LabeledWorkflow (#10786, #10802, #10808, #10833): develop's changes are written against the owning model of this branch: - the lower-isotope bounds and the join read the best match of the linked identifications (getLinkedIdentifications); targeted quantification uses maxIsotope_() and the match sequence; - the TARGETED_RUNS and REQUANTIFIED_* run meta values are removed after editPooledProteins; re-quantification reads its lower bounds from the linked identifications and marks the linked queries (replaceObservation); markTargetedRuns_/markRequantified_ are native, the latter removes the mark from all queries of every run; - splitOffTargeted_ keeps the full identification data in both parts; - MS1LabeledFAIMS::append(result, part) joins maps linked from the same columns and identification data (column sizes add up); - MS1LabeledRatioQuantifier keeps the feature reference and takes develop's targeted/re-quantified sets; its class test adds IDs through the map's identification data (export, append, import). Tests: develop's new MS1LabeledWorkflow tests (7_partial_qpx, pg_dump, requantified_count, min_correlation) are added; 7_attached stays replaced by the class test of 5505030. Expected outputs: MS1LabeledWorkflow_11/13_targeted_mbr_out.consensusXML are develop's new files with the unassigned peptide identifications in the order of the native model (the lines are develop's, permuted; the tool's output equals them block by block). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B51nRFoHvZuVXD7cT8XZav
Description
Follow-up to #10783: fixes the ratio compression at low ratios that #10783 documents as a known limitation. It does this by requiring a channel's isotope pattern before its paired peaks give it a value.
Problem
pairedIntensity_measures a channel against a reference channel from paired peaks. It is shared by the default re-quantification of missing channels (-requantify, in develop before #10783), the join (-join_channels) and the targeted quantification (-targeted_quantification).Changes (all in
MS1LabeledWorkflow.cpp)A peak one isotope below a channel counts as the peptide's own only if it is isotope M+0 to M+n of another channel, with n + 1 the maximum of
algorithm:isotopes_per_peptide. This is the same bound MultiplexFiltering uses. It is decided by a window: the peak is exempt if that isotope's theoretical position lies within twice the m/z tolerance of the position one isotope below. Real centroids are not at 13C spacing, so in triple SILAC some are read there without being exempted (fixed in [TEST,DOC] MS1LabeledWorkflow: pin the join's re-measurement, the 30 % lower-isotope bound and its read window; document the window rule's limits #10808).Whether the exemption applies depends on the label pair and the peptide mass, not on the charge (default
algorithm:mz_toleranceandalgorithm:isotopes_per_peptide):It also applies to the identified channel's clean-spectrum check in targeted mode.
-requantify,-targeted_quantificationand-join_channelshelp, the class doc and the doxygen are updated.lower_isotope_fraction_= 0.3,min_pattern_spectra_= 2).Real data
PXD022659 HeLa SILAC (Lys8/Arg10) dilution series (Pino et al.): 7 points from 70 % to 0 % heavy, 3 DDA runs each (21 runs). Also the 1:1 three-run set from #10783. Same MetaMorpheus PSMs and parameters as in #10783. The numbers were recomputed independently from the outputs. Targeted-mode numbers are from 914abeb; default-mode numbers did not change with that commit, which affects targeted mode only. The #10783 commits merged since then do not change outputs.
Default settings
Triple SILAC (Lys4/Arg6 + Lys8/Arg10), where the lower-isotope exemption applies, default settings
-targeted_quantification trueThe dev and 2x columns cover all targeted features with both channels > 0.
Runtime and memory: unchanged (CPU time ratio 1.00, peak memory ±0.5 %, measured before the last targeted-mode fix, which only widens one condition).
Still open (not in this PR)
-requantify0, so it is left for a separate decision.Tests
MS1LabeledWorkflow_16(Lys8/Arg10 duplex, synthetic). Each case states its setup in the CMake comment.algorithm:isotopes_per_peptide3:4 (still exempt) and 3:3 (not exempt → NaN) pins the bound exactly;MS1LabeledWorkflow_17(join):MS1LabeledWorkflow_18(detected features, which fixture 16 cannot take without shifting the unique ids in its reference):_7_partial)._16_dimethyl,_16_dimethyl_isotopes4and_18_dimethyl_requant(with its_out1), which pin behaviour that does not change.k < nor hard-coded 3–6, no lower check, no pattern requirement, threshold 1, absent rule removed or limited to M0 / M0–M1, reserved peaks counted only at M0–M1, exemption removed (in all paths or only in the re-quantification), gated join count.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. This was on the branch beforedevelopwas merged in; after [FEATURE] MS1LabeledWorkflow: owner-aware blacklist, join of separately detected channels, targeted quantification #10783's squash merge, the branch differs fromdevelopby exactly this PR's changes.Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
Summary by CodeRabbit