Skip to content

[FEATURE] MS1LabeledWorkflow: owner-aware blacklist, join of separately detected channels, targeted quantification - #10783

Merged
timosachsenberg merged 24 commits into
developfrom
claude/issue-10782-silac-coverage
Nov 2, 2026
Merged

timosachsenberg merged 24 commits into
developfrom
claude/issue-10782-silac-coverage

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Implements the three improvements proposed in #10782 for MS1LabeledWorkflow's identified-to-quantified attrition (PhilRe99/openms_silac_nextflow#6), plus a resolver fix found along the way.

Builds on #10781 (merged).

Changes

1. Blacklist that knows which feature owns a peak

  • What changes:
    • MultiplexFiltering records, for every reserved peak, the first and the last filtered peak that reserved it, each with its mass trace (getBlacklistOwners(), also per spectrum).
    • FeatureFinderMultiplexAlgorithm maps each reserved peak to one feature unique id: the first owner's if its multiplet was reported, else the last owner's, or 0 if neither was reported.
    • The 64-bit ids are written as two integer data arrays on each blacklist spectrum (high and low 32 bits: owner_unique_id_high, owner_unique_id_low). They survive mzML (-out_blacklist).
    • Writer order is deterministic for any thread count. If a later pattern that gets dropped reaches back over a reported multiplet's peaks, the peak keeps the reported multiplet as its owner, unless a dropped pattern also reserved it before (see Known limitations).
  • MultiplexResolverAlgorithm, new algorithm:use_blacklist_owners (default false, so behaviour is unchanged without it):
    • Owners are classified as orphan, own, same peptide, unidentified, or other peptide.
    • Foreign owners make a missing channel NaN: unidentified multiplets, other identified peptides, and another multiplet of the same peptide (it already quantifies those peaks, so using them would count the peptide twice). Peaks of no reported feature (orphans) and of the multiplet's own detected channels do not make it NaN.
    • The lookup is two-sided.
    • Channels added for an identification are now checked too.
  • MS1LabeledWorkflow sets that option from -requantify (default true). The re-quantification then skips only peaks with a foreign owner. It reports NaN instead of 0 when the channel would have a value on the reserved peaks it skipped, for example a triplex medium channel on the light channel's own M+4.
  • Logging: log lines count the vetoes by owner class and compare them with the anonymous check.

2. Join of separately detected channels (-join_channels, default true)

When no spectrum holds the complete pattern, FFM can report a peptide's channels as separate partial multiplets, and the peptide gets no ratio.

  • Conditions for a join:
    • Same charge and CV.
    • The partial multiplets elute at the identification.
    • Their m/z matches the expected channel m/z within algorithm:mz_tolerance.
    • They are identified as the same unlabelled peptide, or not at all.
  • Re-measuring: the most intense channel keeps its intensity. The others are re-measured against it from paired peaks over their common elution region, using the owner-aware reserved-peak rule. The two FFM intensities came from different scans, which is why the first attempt (dropped from [FIX] FeatureFinderMultiplex: exact Spearman cutoffs, per-channel RT range, satellite union #10781) gave poor ratios.
  • Rejection: candidates with fewer than 6 paired spectra are not joined.

3. Targeted quantification (-targeted_quantification, default false)

This measures identified peptides that have no multiplet in the run.

  • Window: around the identification (± algorithm:rt_typical), isotopes 0–2 of every channel in the detection's centroided spectra.
  • Elution peak: ElutionPeakDetection on the summed channels.
  • Reference: the identified channel, integrated as the detection does. It needs M0 and M1 in ≥ 3 spectra, no strong peak one isotope below, and an averagine fit.
  • Other channels: measured against the reference from paired peaks. A channel is reported if it co-elutes, 0 if nothing is there, and NaN if another signal occupies its position.
  • Peaks not used: peaks reserved by another identified peptide's multiplet.
  • Overlapping channel isotopes: a lower channel's isotope inside a channel's centroid (e.g. light M+4 in a Lys4/Dimethyl4 channel) is subtracted. Channels are corrected in ascending m/z, and a peak that is mostly such isotopes is left out.
  • One peptide per signal: when targeted peaks of different peptides read the same signal, only the best identification is kept.
  • Flag: features and their identifications carry quantification_method = "targeted".

4. Fix: MultiplexResolverAlgorithm::matchesResidues_

A channel only checked the residue kinds labelled in the pattern channel. With [][Lys8,Arg10], a light K+R peptide therefore matched the Lys8-only pattern, and its partner was placed at +8.014 instead of +18.022 Da. A channel now has to carry one label per residue for every residue kind its sample labels.

Real data

PXD022659: three DDA runs of a nominally 1:1 SILAC mix (Lys8/Arg10), with the deposited MetaMorpheus PSMs and the issue's MS1LabeledWorkflow parameters (knock_out, requantify). A cell is (run, identified peptide form) with L > 0 and H > 0; there are 24,028 identified forms.

forms with H/L cells cells within 1.5× of the median
develop before #10781 9,492 (39.5%) 20,879 96.5%
develop (with #10781) 9,790 (40.7%) 21,826 96.1%
this PR, -join_channels false 9,796 (40.8%) 21,868 96.4%
this PR, defaults (join on) 9,835 (40.9%) 22,079 96.4%
this PR, -targeted_quantification true 15,966 (66.4%) 36,576 95.1%
  • Owner-aware blacklist and residue fix (develop → join off):
    • 381 cells lost (their old ratios 87% within 1.5×) and 423 gained (93%).
    • 1,294 cells changed, going from 94.3% to 96.7% within 1.5×.
    • All 21 changes by more than 1.5× moved towards the median.
  • Join: +214 cells, 99.1% within 1.5×; 3 lost.
  • Targeted:
    • 15,867 cells, 93.0% within 1.5× of 1:1.
    • On the 7,045 targeted cells that MetaMorpheus also quantifies: OpenMS 94.0% within 1.5×, MetaMorpheus 82.1%.
    • Runtime +2.4% against this PR's defaults (24:40 vs 24:05 min wall for the three runs in one call, 1 thread).
  • Triple-label isotope correction: it does not act on this duplex data. Runs with and without it give identical outputs.

Dilution series (known ratios)

The same project also holds a HeLa heavy:light dilution series (Pino et al.). I ran one DDA run per point at 70, 50, 30, 10, 5, 1 and 0% heavy, each on its own, with the same MetaMorpheus PSMs and parameters. The table gives the deviation of the median log2 H/L from the expected value (calibrated on the 50% point), over cells with L, H > 0, in log2 units; positive means compressed towards 1:1.

heavy detected multiplets re-quantified channels targeted (light identified)
30% −0.05 +0.12 +0.29
10% −0.13 +0.44 +0.70
5% −0.42 +0.39 +0.60
  • Default path:

    • With the defaults, the detected multiplets are identical to develop.
    • Targeted quantification only adds features, so protein ratios that are already quantified do not move.
  • What targeted adds:

    • At 70–30% heavy, 42–55% more protein ratios, 98–100% of them within 2×.
    • In the pure-light run, the lowest false-heavy rate per feature: 0.7%, against 3.3% for re-quantified channels and 8% for MetaMorpheus.
  • Where targeted is weak, at ≤ 10% heavy:

    • Its values are compressed towards 1:1, also by +0.05 to +0.14 log2 against MetaMorpheus on the same peptides.
    • Only 45/42/15% of its new protein ratios at 10/5/1% heavy are within 2×.
    • Its 0 (absent) channels shift summed protein abundances by 0.2–0.3 log2.
  • Cause, in pairedIntensity_, which the re-quantification shares. It is the pairing develop's re-quantification already used; develop's re-quantified values are slightly more compressed (10% heavy: +0.57 vs +0.51 in this PR).

    • Isotopes are paired one by one, so a lone heavy M2 counts.
    • The measured channel gets no lower-isotope check.
    • Peaks below the centroid floor drop out instead of counting as low.

    This is why -targeted_quantification stays off by default. The follow-up [FIX] MS1LabeledWorkflow: require the isotope pattern for paired channel intensities #10786 (stacked on this PR) pairs a channel only where its isotope pattern is present, bounds the lower-isotope exemption, and reports a targeted channel as absent only if none of its peaks is seen.

Runtime and memory

The default path on one PXD022659 run (C_0-5ug_DDA_099, 21.08 M MS1 peaks), against develop, 1 thread, max RSS from getrusage:

rt_band 0 (default) rt_band 5
FeatureFinderMultiplex, max RSS +84.7 MiB (+3.4%) +147.4 MiB (+4.5%)
MS1LabeledWorkflow, max RSS +84.5 MiB (+3.3%) +148.0 MiB (+4.4%)
FeatureFinderMultiplex, wall vs develop 1.042 and 0.999 (two pairs) 1.023
  • Wall time: no measurable cost at rt_band 0; the same develop binary varied by 5.6%. MS1LabeledWorkflow ran faster than develop at rt_band 0 (0.903), but only in the filtering step it shares with FeatureFinderMultiplex, so that is not a gain from this PR.
  • Memory:
    • 80.4 MiB is the owner array, one int per MS1 peak above the cutoff.
    • The rest grows with rt_band: records of peaks reserved more than once and the list of accepted filtered peaks (4 MiB at rt_band 0, 67 MiB at rt_band 5).
    • Max RSS is reached in a spike at the end of filtering that develop has too.
  • Outputs: FeatureFinderMultiplex's features and multiplets are identical to develop's (after masking unique ids) at rt_band 0 and 5.
  • 4 threads (the machine has 4 cores), measured before the compact owner storage: the memory excess was within about 5 MiB of the 1-thread excess (at most 5.2 MiB), and the outputs were identical to 1 thread.
  • Before the compact owner storage: at rt_band 5, FeatureFinderMultiplex took +678.4 MiB (+20.6%) and MS1LabeledWorkflow +678.2 MiB (+20.2%). Commit ec2143f brought it down to the numbers above.

Tests

  • New class tests: MultiplexFiltering (owners, writer order, thread determinism, and a direct test that reserves peaks by hand: of three writers of one peak, the first and the last are kept, also per spectrum), FeatureFinderMultiplexAlgorithm (owner ids), MultiplexResolverAlgorithm (classification, two-sided lookup, matchesResidues_, expectedChannelMZs).
  • New TOPP fixtures:
    • MultiplexResolver_5 (with and without owners).
    • MS1LabeledWorkflow 8–15, covering:
      • join;
      • join tolerance;
      • owners;
      • reserved peaks;
      • targeted cases: conflicts between identifications (including swapped scores), MBR replacement, other-peptide multiplets;
      • fixture 15: triple-Dimethyl isotope overlap with light, medium and heavy identifications.
    • MS1LabeledWorkflow 19: FAIMS, fixture 8 at two compensation voltages.
      • A partial multiplet at another CV is not joined.
      • Re-quantification and the resolver's check of reserved peaks use only the spectra and reserved peaks of their own CV; targeted quantification uses only the spectra of its identification's CV.
      • Owners come from one detection per CV.
  • How the tests were checked:
    • Each targeted rule was pinned by mutants that fail the tests meant for them.
    • For fixture 19, removing any CV check it covers fails at least one of its 8 tests.
  • Existing references: only MS1LabeledWorkflow_7_partial_out.consensusXML changes, in the order of one meta value (feature_id). Its only cause is the default join.
  • Local run: all 376 tests that ctest -R "MS1LabeledWorkflow|Multiplex|ConsensusMap|MzTab|ExperimentalDesign|QPX|StatisticFunctions|ProteomicsLFQ|OpenNuXL|FeatureFinderMultiplex|IMDataConverter" selects pass. These are the class and TOPP tests whose names contain one of these words.

Known limitations

  • Ratio compression at low ratios: targeted values, and to a lesser degree re-quantified channels (as already in develop), are compressed at ≤ 10% heavy (see the dilution series above). Reduced by [FIX] MS1LabeledWorkflow: require the isotope pattern for paired channel intensities #10786.
  • Triple-label isotope correction is validated on synthetic data only (fixture 15):
    • isotopes above M+5 are not corrected;
    • every channel uses the identified sequence's isotope distribution;
    • an unrelated peak at a lower channel's m/z is taken for that channel and subtracted. Only the 20% rule bounds this.
  • A partner is joined to one partial multiplet only:
    • If the detection splits one channel into two identified partial multiplets, the partner goes to one of them.
    • The peptide ratio is unaffected. The summed channel abundances miss the other partial's share, or count it twice if the partner is the reference.
    • Seen once in 470 joins on PXD022659: one light elution was split in m/z, its two parts 8.1 ppm apart, outside the 6 ppm detection tolerance.
  • Owners in the middle are not kept:
    • Only the first and the last filtered peak that reserved a peak are recorded.
    • A reported multiplet that reserved it in between loses it. If the first and the last writer were both dropped, the peak then counts as reserved by no reported feature.
    • At rt_band 0 (default), 0 of 1,099,702 blacklisted peaks on a full run had three or more writers.
    • At rt_band 3, 630 of 2,813,129 (0.022%) on half a run lost their reported owner. None of the 7 affected multiplets checked changed a veto or a re-quantified value (2 more were not checked); the join and targeted paths were not checked.

Closes #10782.

🤖 Generated with Claude Code

https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ

claude added 17 commits October 30, 2026 16:24
…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
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 15 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9f2e11b0-005a-4272-8666-d7c9275f7177
Commits

Reviewing files that changed from the base of the PR and between 19dbca3 and 74e3926.

Files selected for processing: 75
  • src/openms/include/OpenMS/FEATUREFINDER/FeatureFinderMultiplexAlgorithm.h
  • src/openms/include/OpenMS/FEATUREFINDER/MultiplexFiltering.h
  • src/openms/include/OpenMS/FEATUREFINDER/MultiplexResolverAlgorithm.h
  • src/openms/source/FEATUREFINDER/FeatureFinderMultiplexAlgorithm.cpp
  • src/openms/source/FEATUREFINDER/MultiplexFiltering.cpp
  • src/openms/source/FEATUREFINDER/MultiplexResolverAlgorithm.cpp
  • src/tests/class_tests/openms/source/FeatureFinderMultiplexAlgorithm_test.cpp
  • src/tests/class_tests/openms/source/MultiplexFilteringCentroided_test.cpp
  • src/tests/class_tests/openms/source/MultiplexResolverAlgorithm_test.cpp
  • src/tests/topp/CMakeLists.txt
  • src/tests/topp/MS1LabeledWorkflow_10.fasta
  • src/tests/topp/MS1LabeledWorkflow_10.idXML
  • src/tests/topp/MS1LabeledWorkflow_10_input.mzML
  • src/tests/topp/MS1LabeledWorkflow_10_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_11.fasta
  • src/tests/topp/MS1LabeledWorkflow_11.idXML
  • src/tests/topp/MS1LabeledWorkflow_11_apex.idXML
  • src/tests/topp/MS1LabeledWorkflow_11_conflicts.fasta
  • src/tests/topp/MS1LabeledWorkflow_11_conflicts.idXML
  • src/tests/topp/MS1LabeledWorkflow_11_conflicts_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_11_default_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_11_input.mzML
  • src/tests/topp/MS1LabeledWorkflow_11_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_11_targeted_mbr_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_12.fasta
  • src/tests/topp/MS1LabeledWorkflow_12.idXML
  • src/tests/topp/MS1LabeledWorkflow_12_input.mzML
  • src/tests/topp/MS1LabeledWorkflow_12_no_requantify_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_12_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_12_targeted_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_13.fasta
  • src/tests/topp/MS1LabeledWorkflow_13.idXML
  • src/tests/topp/MS1LabeledWorkflow_13_input.mzML
  • src/tests/topp/MS1LabeledWorkflow_13_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_13_targeted_mbr_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_13b.idXML
  • src/tests/topp/MS1LabeledWorkflow_13c.idXML
  • src/tests/topp/MS1LabeledWorkflow_14.fasta
  • src/tests/topp/MS1LabeledWorkflow_14.idXML
  • src/tests/topp/MS1LabeledWorkflow_14_input.mzML
  • src/tests/topp/MS1LabeledWorkflow_14_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_15.fasta
  • src/tests/topp/MS1LabeledWorkflow_15.idXML
  • src/tests/topp/MS1LabeledWorkflow_15_heavy.idXML
  • src/tests/topp/MS1LabeledWorkflow_15_heavy_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_15_input.mzML
  • src/tests/topp/MS1LabeledWorkflow_15_medium.idXML
  • src/tests/topp/MS1LabeledWorkflow_15_medium_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_15_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_19.fasta
  • src/tests/topp/MS1LabeledWorkflow_19.idXML
  • src/tests/topp/MS1LabeledWorkflow_19_input.mzML
  • src/tests/topp/MS1LabeledWorkflow_19_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_19_samecv_input.mzML
  • src/tests/topp/MS1LabeledWorkflow_19_samecv_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_19_targeted_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_7_partial_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_8.fasta
  • src/tests/topp/MS1LabeledWorkflow_8.idXML
  • src/tests/topp/MS1LabeledWorkflow_8_input.mzML
  • src/tests/topp/MS1LabeledWorkflow_8_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_9.fasta
  • src/tests/topp/MS1LabeledWorkflow_9.idXML
  • src/tests/topp/MS1LabeledWorkflow_9_default_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_9_input.mzML
  • src/tests/topp/MS1LabeledWorkflow_9_isomer.fasta
  • src/tests/topp/MS1LabeledWorkflow_9_isomer.idXML
  • src/tests/topp/MS1LabeledWorkflow_9_out.consensusXML
  • src/tests/topp/MultiplexResolver_5_blacklist.mzML
  • src/tests/topp/MultiplexResolver_5_input.consensusXML
  • src/tests/topp/MultiplexResolver_5_output.consensusXML
  • src/tests/topp/MultiplexResolver_5_owners_output.consensusXML
  • src/topp/FeatureFinderMultiplex.cpp
  • src/topp/MS1LabeledWorkflow/MS1LabeledWorkflow.cpp
  • src/topp/MultiplexResolver.cpp

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2a23bb4a-29a5-4c96-8e6a-088bcec448e3
Commits

Reviewing files that changed from the base of the PR and between 138627b and 19dbca3.

Files ignored due to path filters: 4
  • src/tests/topp/ProteomicsLFQ_3_out.csv is excluded by !**/*.csv
  • src/tests/topp/ProteomicsLFQ_3_seedRT_out.csv is excluded by !**/*.csv
  • src/tests/topp/ProteomicsLFQ_9_out.csv is excluded by !**/*.csv
  • src/tests/topp/ProteomicsLFQ_9_seedRT_out.csv is excluded by !**/*.csv
Files selected for processing: 98
  • src/openms/include/OpenMS/FEATUREFINDER/FeatureFinderMultiplexAlgorithm.h
  • src/openms/include/OpenMS/FEATUREFINDER/MultiplexFiltering.h
  • src/openms/include/OpenMS/FEATUREFINDER/MultiplexResolverAlgorithm.h
  • src/openms/include/OpenMS/MATH/StatisticFunctions.h
  • src/openms/source/FEATUREFINDER/FeatureFinderMultiplexAlgorithm.cpp
  • src/openms/source/FEATUREFINDER/MultiplexFiltering.cpp
  • src/openms/source/FEATUREFINDER/MultiplexResolverAlgorithm.cpp
  • src/tests/class_tests/openms/source/FeatureFinderMultiplexAlgorithm_test.cpp
  • src/tests/class_tests/openms/source/MultiplexFilteringCentroided_test.cpp
  • src/tests/class_tests/openms/source/MultiplexResolverAlgorithm_test.cpp
  • src/tests/class_tests/openms/source/StatisticFunctions_test.cpp
  • src/tests/topp/CMakeLists.txt
  • src/tests/topp/FeatureFinderMultiplex_10_output.consensusXML
  • src/tests/topp/FeatureFinderMultiplex_10_output.featureXML
  • src/tests/topp/FeatureFinderMultiplex_11_output.featureXML
  • src/tests/topp/FeatureFinderMultiplex_4_output.consensusXML
  • src/tests/topp/FeatureFinderMultiplex_4_output.featureXML
  • src/tests/topp/FeatureFinderMultiplex_5_output.consensusXML
  • src/tests/topp/FeatureFinderMultiplex_5_output.featureXML
  • src/tests/topp/FeatureFinderMultiplex_6_output.consensusXML
  • src/tests/topp/FeatureFinderMultiplex_6_output.featureXML
  • src/tests/topp/FeatureFinderMultiplex_9_output.consensusXML
  • src/tests/topp/FeatureFinderMultiplex_9_output.featureXML
  • src/tests/topp/MS1LabeledWorkflow_10.fasta
  • src/tests/topp/MS1LabeledWorkflow_10.idXML
  • src/tests/topp/MS1LabeledWorkflow_10_input.mzML
  • src/tests/topp/MS1LabeledWorkflow_10_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_11.fasta
  • src/tests/topp/MS1LabeledWorkflow_11.idXML
  • src/tests/topp/MS1LabeledWorkflow_11_apex.idXML
  • src/tests/topp/MS1LabeledWorkflow_11_conflicts.fasta
  • src/tests/topp/MS1LabeledWorkflow_11_conflicts.idXML
  • src/tests/topp/MS1LabeledWorkflow_11_conflicts_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_11_default_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_11_input.mzML
  • src/tests/topp/MS1LabeledWorkflow_11_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_11_targeted_mbr_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_12.fasta
  • src/tests/topp/MS1LabeledWorkflow_12.idXML
  • src/tests/topp/MS1LabeledWorkflow_12_input.mzML
  • src/tests/topp/MS1LabeledWorkflow_12_no_requantify_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_12_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_12_targeted_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_13.fasta
  • src/tests/topp/MS1LabeledWorkflow_13.idXML
  • src/tests/topp/MS1LabeledWorkflow_13_input.mzML
  • src/tests/topp/MS1LabeledWorkflow_13_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_13_targeted_mbr_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_13b.idXML
  • src/tests/topp/MS1LabeledWorkflow_13c.idXML
  • src/tests/topp/MS1LabeledWorkflow_14.fasta
  • src/tests/topp/MS1LabeledWorkflow_14.idXML
  • src/tests/topp/MS1LabeledWorkflow_14_input.mzML
  • src/tests/topp/MS1LabeledWorkflow_14_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_15.fasta
  • src/tests/topp/MS1LabeledWorkflow_15.idXML
  • src/tests/topp/MS1LabeledWorkflow_15_heavy.idXML
  • src/tests/topp/MS1LabeledWorkflow_15_heavy_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_15_input.mzML
  • src/tests/topp/MS1LabeledWorkflow_15_medium.idXML
  • src/tests/topp/MS1LabeledWorkflow_15_medium_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_15_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_1_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_1_out.mzTab
  • src/tests/topp/MS1LabeledWorkflow_2_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_2_out.mzTab
  • src/tests/topp/MS1LabeledWorkflow_3_mbr_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_3_targeted_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_4_identity_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_4_identity_out.mzTab
  • src/tests/topp/MS1LabeledWorkflow_6_ratios_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_7_partial_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_8.fasta
  • src/tests/topp/MS1LabeledWorkflow_8.idXML
  • src/tests/topp/MS1LabeledWorkflow_8_input.mzML
  • src/tests/topp/MS1LabeledWorkflow_8_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_9.fasta
  • src/tests/topp/MS1LabeledWorkflow_9.idXML
  • src/tests/topp/MS1LabeledWorkflow_9_default_out.consensusXML
  • src/tests/topp/MS1LabeledWorkflow_9_input.mzML
  • src/tests/topp/MS1LabeledWorkflow_9_isomer.fasta
  • src/tests/topp/MS1LabeledWorkflow_9_isomer.idXML
  • src/tests/topp/MS1LabeledWorkflow_9_out.consensusXML
  • src/tests/topp/MultiplexResolver_5_blacklist.mzML
  • src/tests/topp/MultiplexResolver_5_input.consensusXML
  • src/tests/topp/MultiplexResolver_5_output.consensusXML
  • src/tests/topp/MultiplexResolver_5_owners_output.consensusXML
  • src/tests/topp/ProteomicsLFQ_3_out.consensusXML
  • src/tests/topp/ProteomicsLFQ_3_out.mzTab
  • src/tests/topp/ProteomicsLFQ_3_seedRT_out.consensusXML
  • src/tests/topp/ProteomicsLFQ_3_seedRT_out.mzTab
  • src/tests/topp/ProteomicsLFQ_9_out.consensusXML
  • src/tests/topp/ProteomicsLFQ_9_out.mzTab
  • src/tests/topp/ProteomicsLFQ_9_seedRT_out.consensusXML
  • src/tests/topp/ProteomicsLFQ_9_seedRT_out.mzTab
  • src/topp/FeatureFinderMultiplex.cpp
  • src/topp/MS1LabeledWorkflow/MS1LabeledWorkflow.cpp
  • src/topp/MultiplexResolver.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

The changes add blacklist ownership metadata from filtering through feature generation and resolution. The resolver can use owner IDs to evaluate missing and identification-added channels, and pattern matching now uses sample label sets. The pull request also updates feature-map calculations and adds resolver, labeled-workflow, and rank-correlation regression coverage.

Changes: Multiplex ownership and resolver behavior

Layer / File(s) Summary
Record blacklist writers
src/openms/include/OpenMS/FEATUREFINDER/MultiplexFiltering.h, src/openms/source/FEATUREFINDER/MultiplexFiltering.cpp
Filtering records the first and latest accepted peak that wrote each blacklist entry and exposes the ownership records in blacklist order.
Map reservations to features
src/openms/include/OpenMS/FEATUREFINDER/FeatureFinderMultiplexAlgorithm.h, src/openms/source/FEATUREFINDER/FeatureFinderMultiplexAlgorithm.cpp, src/topp/FeatureFinderMultiplex.cpp
Feature generation collects provisional per-channel IDs, maps blacklist writers to final feature IDs, and assigns channel headers by configured channel index. The blacklist option description documents owner IDs.
Resolve channels using owners
src/openms/include/OpenMS/FEATUREFINDER/MultiplexResolverAlgorithm.h, src/openms/source/FEATUREFINDER/MultiplexResolverAlgorithm.cpp, src/topp/MultiplexResolver.cpp
When enabled and valid owner data is available, the resolver classifies nearby reserved peaks and applies owner-aware checks to missing and identification-added channels. Pattern matching uses sample label sets.
Regression coverage
src/tests/class_tests/openms/source/*Multiplex*, src/tests/topp/CMakeLists.txt, src/tests/topp/FeatureFinderMultiplex_*, src/tests/topp/MultiplexResolver_5_*, src/tests/topp/MS1LabeledWorkflow_*
Tests cover blacklist ownership, feature mapping, owner-aware resolution, label matching, channel joining, and targeted quantification. Test fixtures record the corresponding expected outputs.

Rank-correlation calculation

Layer / File(s) Summary
Update calculation and expected outputs
src/openms/include/OpenMS/MATH/StatisticFunctions.h, src/tests/class_tests/openms/source/StatisticFunctions_test.cpp, src/tests/topp/ProteomicsLFQ_*
The denominator expression changes, tests add exact correlation checks, and ProteomicsLFQ expected-output fixtures are updated.

Sequence Diagram(s)

sequenceDiagram
  participant FeatureFinderMultiplex
  participant MultiplexFiltering
  participant MultiplexResolverAlgorithm
  FeatureFinderMultiplex->>MultiplexFiltering: collect blacklist reservation writers
  FeatureFinderMultiplex->>MultiplexResolverAlgorithm: provide owner IDs with blacklist
  MultiplexResolverAlgorithm->>MultiplexResolverAlgorithm: classify nearby owners
  MultiplexResolverAlgorithm->>MultiplexResolverAlgorithm: evaluate missing and added channels
Loading

Possibly related PRs

  • OpenMS/OpenMS#10692: Both changes track information about blacklist writes and use it to connect reserved peaks to their writers.
  • OpenMS/OpenMS#10781: This PR builds on feature-finder behavior that #10781 changed, including rank correlation, retention-time ranges, and channel indexing.

Change: Feature · Severity of issue fixed: Medium

Merge Risk: Minimal · previous review 19dbc

No actionable merge-blocking issue was established. The change is mergeable after normal checks.

Pre-merge checks: Passed 2 · Failed 3

Failed Failed checks: 3 warnings

Check name Status Explanation Resolution
Linked Issues check Warning The owner-aware blacklist, targeted quantification, quantification-method flag, residue matching fix, and related tests address the corresponding requirements in #10782. The channel-join implementatio… Add a join criterion that verifies shared peptide signal for unidentified candidates, such as correlated elution profiles with overlapping RT extent or an equivalent discriminator. Add regression coverage for rejection of unrelated partial …
Out of Scope Changes check Warning The change to Math::rankCorrelationCoefficient in src/openms/include/OpenMS/MATH/StatisticFunctions.h and its exact-value test in StatisticFunctions_test.cpp are not connected to the #10782 MS1L… Remove the unrelated rank-correlation and dependent ProteomicsLFQ fixture changes, or link them to a separate issue with coding requirements.
Docstring Coverage Warning Docstring coverage is 20.51% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 2 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the three main changes to MS1LabeledWorkflow: owner-aware blacklist handling, joining separately detected channels, and targeted quantification. The raw summary and PR objectives confi…
Full details: Title check

Explanation

The title names the three main changes to MS1LabeledWorkflow: owner-aware blacklist handling, joining separately detected channels, and targeted quantification. The raw summary and PR objectives confirm that these changes are the main body of work, with residue-matching fixes and test/fixture updates as supporting changes. The title is 114 characters, which is long, but it stays on topic and does not use vague terms.

Full details: Linked Issues check

Explanation

The owner-aware blacklist, targeted quantification, quantification-method flag, residue matching fix, and related tests address the corresponding requirements in #10782. The channel-join implementation does not establish that unidentified partial multiplets belong to the same peptide. It uses charge/CV, identification RT, expected-channel m/z, and a minimum of six paired spectra. The supplied evidence states that it has no elution-profile correlation gate. The issue identifies m/z and RT proximity as insufficient for this join decision.

Resolution

Add a join criterion that verifies shared peptide signal for unidentified candidates, such as correlated elution profiles with overlapping RT extent or an equivalent discriminator. Add regression coverage for rejection of unrelated partial multiplets.

Full details: Out of Scope Changes check

Explanation

The change to Math::rankCorrelationCoefficient in src/openms/include/OpenMS/MATH/StatisticFunctions.h and its exact-value test in StatisticFunctions_test.cpp are not connected to the #10782 MS1LabeledWorkflow requirements. The associated ProteomicsLFQ output fixture changes are also outside the stated workflow, blacklist, resolver, join, and targeted-quantification scope.

Resolution

Remove the unrelated rank-correlation and dependent ProteomicsLFQ fixture changes, or link them to a separate issue with coding requirements.

Full details: Docstring Coverage

Explanation

Docstring coverage is 20.51% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 39 functions across 13 files. (74 skipped: 74 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit records each peak in the queue,
First and last owners come into view.
Channels are checked by label and trace,
Ratios find room in a measured place.
The moonlit tests mark each path anew.

…verage

develop's only new commit is the squash of #10781, whose tree equals 78bfeaa,
the #10781 head this branch is built on; so this branch's tree is kept as is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…oxygen reference

'@ref run:' made doxygen look up 'run:' (Doxygen_Warning_test failed on CI).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ

@timosachsenberg timosachsenberg left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-generated initial review

This is an automated, AI-generated first review. It looks for high- and medium-priority issues only (no nits) and checks whether the PR has tests and measurements. I read the code at 81788e34 against develop (a3e7dea0). Please double-check anything before acting on it. A maintainer will follow up.

I could not build or run OpenMS here, because the vcpkg sources and Arrow ≥ 24 are not available. I did port MultiplexResolverAlgorithm::matchesResidues_ to a standalone Python check (K, R, K+R, KK and KK+R peptides; [][Lys8,Arg10], plus a triplex whose medium sample labels only K). CI is green at this head on every platform, Windows included.

Verdict: I found no high- or medium-priority issue. The owner bookkeeping does not change what FeatureFinderMultiplex detects. The new resolver option is off by default outside MS1LabeledWorkflow. The existing MS1LabeledWorkflow references stay the same apart from the explained meta-value order. The open points are a FAIMS test and a runtime/memory number for the default path.

Checked and found sound

  • Blacklist owners (MultiplexFiltering). applyBlacklistEntries_ writes the same entries, with the same values and in the same order, as before. The owners are only recorded next to them.
    • So a peak cannot be claimed by anything that could not claim it before, and no pattern loses peaks.
    • In the parallel path, the owners are written in the serial, m/z-ordered acceptance loop, so they do not depend on the thread count. The extended test checks this for 1, 2, 4 and 8 threads.
  • FeatureFinderMultiplexAlgorithm.
    • unique_id_of.at(owner) (FeatureFinderMultiplexAlgorithm.cpp:1240) cannot throw. Only channels of reported multiplets enter multiplet_ids, and all their features are in feature_map_.
    • The owner arrays are built in the same loop order as getBlacklist(), so they stay aligned with the peaks.
    • The featureXML and consensusXML outputs are unchanged. Only -out_blacklist gains the two integer arrays, and no FeatureFinderMultiplex reference changed.
  • Resolver.
    • algorithm:use_blacklist_owners defaults to false. So MultiplexResolver output only changes through the matchesResidues_ fix, and the MultiplexResolver_1–4 references are unchanged.
    • In my port, a light K+R peptide with [][Lys8,Arg10] now matches only the Lys8+Arg10 pattern. Before, it also matched the Lys8-only and the Arg10-only patterns. K-only, R-only, KK and no-K/R peptides match as before.
    • One correction for the description: it says only unidentified and other-peptide owners make a channel NaN. isForeign() (MultiplexResolverAlgorithm.cpp:475) and the docs count same-peptide owners as well.
  • MS1LabeledWorkflow default path.
    • References 1–6 are unchanged. So is 3_targeted, which runs with rt_band 5, so its peaks are reserved by several patterns.
    • In 7_partial only feature_id moves. The join calls unlabelled_() → stripLabels_(), which registers the MS1Label:* keys earlier. That matches the description.
  • Join.
    • A partner needs the same charge and CV. Its m/z has to be within the detection's ppm tolerance of expectedChannelMZs(), and the identification RT within its hull ± id_mapping:rt_tolerance.
    • Each partner is used once (taken). Its identifications move to the target and the partner is removed, so nothing is counted twice.
    • Each pass of the rejection loop drops one partner, so the loop always ends. The second keepMultiAssignedOnClosest_ replaces the map_index 0 placeholders.
    • The flank chain in mergeFragments_ cannot cycle, because sizes strictly increase along it.
  • Targeted quantification (off by default).
    • Identifications without signal stay unassigned.
    • Peptides without a labelable residue, or without a fitting pattern, are skipped (no_pattern).
    • The peptide key includes the charge. So a charge state without a multiplet is measured as its own ion and does not add to the multiplet's value.
    • NaN channels are dropped before output.
    • Savitzky–Golay leaves windows shorter than its frame unsmoothed instead of failing.
  • OpenMP. The only parallel region is in MultiplexFiltering::filterSpectrum_. The resolver and the workflow code are serial.
  • pyOpenMS. The bound methods (resolve, checkIdentifications, expectedChannelMZs, getBlacklist) keep their signatures. The new static helpers (blacklistOwner, hasBlacklistOwners, classifyBlacklistOwner, …) are not bound. Python users can still read the owners with getIntegerDataArrays().

Not repeated here, already on the PR

  • CodeRabbit (linked-issues check): the join accepts an unidentified partner without any elution-profile criterion. The head documents this as deliberate (MS1LabeledWorkflow.cpp:1075-1076), but nobody has answered on the PR, so it still looks open at this head.

Two cases I could not settle (questions, not findings)

I could not build a realistic input for either, so please judge whether they can happen:

  • One heavy partial spanning two light partials (MS1LabeledWorkflow.cpp:1186, :1263). Suppose FeatureFinderMultiplex splits an identified light channel into two partials L1 and L2, and finds one heavy partial H that spans both. The join gives H to L1 (taken), re-measured as R × I(L1). L2's heavy dummy then sees H's peaks as owned by the same peptide and becomes NaN. So the summed heavy misses L2's share.
  • Owners in the middle are not kept (MultiplexFiltering.cpp:380-395, provisionalOwners). Only the first and the last writer of a peak are recorded. If both of those multiplets are dropped and one in the middle is reported, the peak looks like an orphan, and the re-quantification may use it. This needs three patterns on one peak.

Tests

  • Good. Every new behaviour has a test that fails without it.

    • Class tests assert concrete owner ids: light, heavy, orphan, and the peaks of a dropped pattern with rt_band, for both profile and centroided input. They also cover thread determinism of the owners, classification, the two-sided lookup, the K+R pattern choice, and expectedChannelMZs.
    • TOPP fixtures 8–15 and MultiplexResolver_5 compare outputs and pin the log counts. MultiplexResolver_5 has different expected outputs with and without owners.
  • Gap: FAIMS. None of the new CV-dependent code is exercised, and there is no MS1LabeledWorkflow FAIMS TOPP test at all. The untested code:

    • the join's compensationVoltage_(channel) != cv check;
    • the CV match in blacklistSpectrum_;
    • the targeted candidate.cv;
    • owner arrays that come from separate FeatureFinderMultiplex runs per CV.

    A small fixture would cover it: take MS1LabeledWorkflow_8_input.mzML and give it two CVs, with the heavy partial only at the second CV (FAIMS_CV meta value or drift time with FAIMS_COMPENSATION_VOLTAGE). Then assert that the join log reports 0 partial multiplet(s) were found… and that the light multiplet's heavy channel is not taken from the other CV.

Measurements

  • Real data: yes, and plenty.

    • PXD022659: three DDA runs, with before/after numbers for each component.
    • A 7-point dilution series with known ratios.
    • A comparison against MetaMorpheus.

    This convincingly backs the ratio claims. The description is also open about targeted values being compressed at ≤ 10 % heavy, which is why that option is off by default.

  • Missing: runtime and memory of the default path.

    • The owner bookkeeping runs for every FeatureFinderMultiplex user, not only MS1LabeledWorkflow.
      • blacklist_owner_ adds one int per centroided peak.
      • blacklist_first_owner_ adds one hash-map node per peak reserved by more than one filtered peak. With rt_band > 0, the next spectrum's filtered peak of the same pattern passes again (the primary-peak and same-trace satellite rules) and re-reserves most of the same peaks. So this map then holds roughly one node per blacklisted peak.
    • The join is on by default.
    • The only runtime number is for targeted quantification (24:40 vs 24:05 min, 1 thread), and the baseline is not named.

    The cheapest convincing measurement: /usr/bin/time -v (wall time and max RSS) of FeatureFinderMultiplex and MS1LabeledWorkflow on one PXD022659 run, develop against this head, with defaults, on 1 and 8 threads, once with the default rt_band 0 and once with -algorithm:rt_band 5.

  • No FAIMS data was measured. Together with the missing test above, the CV handling of the new code is unverified.


Generated by Claude Code

… owners and targeted quantification per CV)

MS1LabeledWorkflow_19 is fixture 8 acquired at two FAIMS compensation voltages (-45 V and -60 V, one MS1
spectrum per CV at every RT, both with the same RT), with the identifications at -45 V. A peptide's
heavy channel at -60 V is not joined to its light partial multiplet at -45 V, the missing channels at
-45 V are re-quantified from the -45 V spectra only and not vetoed or skipped because of peaks reserved
at -60 V, and the targeted quantification measures at the CV of the identification. The samecv input
(the same peaks with two heavy channels at -45 V) is the positive control: the join then gives fixture
8's values and the targeted quantification measures the heavy channel.

Eight tests: _19_faims_split (+_out1), _19_faims_owners, _19_faims_samecv (+_out1),
_19_faims_targeted (+_out1), _19_faims_samecv_targeted. Every test fails for at least one scratch
mutant that drops a CV check: the join candidate CV check, the CV match of the blacklist spectrum
lookup, the CV filters of the re-quantification and of the targeted measurement, the candidate's CV,
and both CV checks of MultiplexResolverAlgorithm (owner check and plain blacklist check). The inputs
were generated from fixture 8's peaks by a stand-alone script that is not part of the repository.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…Workflow: limits of blacklist owners and channel joins

Only the first and the last filtered peak that reserved a peak are recorded: a reported multiplet that
reserved it in between loses it when the clusters of both are dropped, and the peak then counts as
reserved by no reported feature. That needs at least three writers of one peak, in practice only with
algorithm:rt_band > 0. Stated at MultiplexFiltering::getBlacklistOwners() and applyBlacklistEntries_(),
in the provisionalOwners() comment, in FeatureFinderMultiplexAlgorithm::getBlacklist() (whose rule for
peaks reserved by several patterns is corrected: the first one if its multiplet was reported, else the
last one) and briefly in the description of algorithm:use_blacklist_owners.

joinChannelsOfIdentifiedPeptides_: a partner is joined to one partial multiplet only; another
identified partial multiplet of the same channels that it spans keeps its own multiplet, in which the
partner's channel is not quantifiable, so the summed channel abundances miss the partner channel's share
of it (or, if the partner was the reference, count its share of the identified channels twice).

No behaviour change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…klist owners compactly

The owner bookkeeping of the blacklist cost memory in proportion to the number of reserved peaks, which grows
strongly with algorithm:rt_band > 0 (a pattern reserves its mass traces over the RT band, so many peaks are
reserved several times):

- MultiplexFiltering: the first owner of a peak reserved by more than one filtered peak was kept in an
  unordered_map (one node per such peak, plus a hash lookup on every overwrite). blacklist_owner_ now encodes
  the owners itself: -1 not reserved, >= 0 the only filtered peak that reserved the peak, <= -2 the index
  (-2 - value) of a record {first, first_value, last} in blacklist_owner_records_. The record is created when
  another filtered peak reserves the peak for the first time, so the first owner and its value are the same as
  with the map; later writers only update record.last. O(1) per write, no hash map.
- filtered_peaks_ and BlacklistWriter store the peak index as unsigned instead of size_t (BlacklistWriter
  shrinks from 24 to 12 bytes). Owners and records are indexed by int, so applyBlacklistEntries_() throws
  Exception::InvalidSize before the filtered peaks, or the records, would exceed INT_MAX (one check per
  filtered peak; documented).
- New getBlacklistOwners(Size spectrum_index) returns the owners of one spectrum. FeatureFinderMultiplexAlgorithm
  reads them spectrum by spectrum after generating the maps (centroided and profile branch), instead of holding
  a full copy of all owners (getBlacklistOwners()) during clustering and map generation. getBlacklistOwners()
  stays as a convenience for the class test.

What is recorded and reported does not change: only the first and the last writer of a peak, as documented.
Outputs are unchanged: on an RT slice (25-37 min, MS1 only) of PXD022659 run 099 with the FeatureFinderMultiplex
parameters of the runtime measurement plus -test -out_blacklist, featureXML, consensusXML and the blacklist
mzML (including owner_unique_id_high/low) are byte-identical to before at rt_band 0 and 5, and so are the logs
apart from timings. Peak RSS on that slice (1 thread, without -out_blacklist as in the runtime measurement):
rt_band 0: develop 197.3, before 213.6, now 206.1 MiB; rt_band 5: develop 241.0, before 288.3, now 259.5 MiB.

MultiplexFilteringCentroided_test additionally checks that getBlacklistOwners(Size) matches
getBlacklistOwners() and throws for an index past the last spectrum.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
… of a peak

MultiplexFilteringCentroided_test gets a section that reserves peaks of two spectra by hand
(applyBlacklistEntries_() through a derived tester) for three filtered peaks A, B and C, and checks
getBlacklistOwners() against hand-computed owners: a single writer is first and last owner; A rewriting its
own peak adds no record, and the mass trace it leaves is the one kept for the first owner; of three writers,
A (first) and C (last) are kept and B is dropped; a second record in the second spectrum; the number of
records after each writer; getBlacklistOwners(Size) and its IndexOverflow; alignment with getBlacklist()
across a white peak. Every expected writer has a nonzero mass trace, so none of them equals a value-initialized
BlacklistWriter. A list of the wrong size fails its size check and skips only the checks of its entries, not
the independent checks after it.

It replaces the check in the threads section that compared getBlacklistOwners(s) with
getBlacklistOwners()[s], which could not fail since the latter is built from the former.

MultiplexFiltering.h: the doc of applyBlacklistEntries_() put the last owner in blacklist_owner_; once a
peak has a record, the record holds it.

Each of these mutants of MultiplexFiltering.cpp fails the new section: the record's first value taken from
the new entry; record.last not updated; a record also on an own rewrite; no records at all; every record
addressed as the first one; the first owner's mass trace read from the current value; the per-spectrum
owners stopping at the first white peak; record.first set to the new owner. Six of them pass the rest of
the test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ
…he join's doc

joinChannelsOfIdentifiedPeptides_: the one observed case of a partner that spans two identified partial
multiplets is a light elution split in m/z because its centroids scatter by more than the detection's m/z
tolerance (8.1 ppm between the two partials, tolerance 6 ppm), not a split within that tolerance as the
doc said.

No behaviour change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmbpvTPyiZ7DxhD6MoJ

Copy link
Copy Markdown
Contributor Author

Answers to the review, point by point.

  • FAIMS: new fixture 19 (8 tests) covers the four points the review lists. Removing any CV check it covers makes at least one test fail.
  • Runtime and memory: the default path (rt_band 0) costs +84.7 MiB max RSS (+3.4 %) and no measurable wall time. A new commit cuts the rt_band 5 excess from +678 to +147 MiB. Outputs do not change (FeatureFinderMultiplex byte-identical; the workflow identical at rt_band 0, with identical logs at rt_band 5).
  • Q A and Q B: both can happen and both are rare. Q A (once in 470 joins) leaves the peptide ratio right; only summed abundances miss a share (or count it twice if the partner is the reference). Q B changed none of the vetoes and re-quantified values checked. Both are now documented; the code is unchanged.
  • CodeRabbit's join criterion: an elution-profile criterion does not separate good from bad joins (AUC 0.56). The m/z tolerance and the re-measurement do. Tests pin the rejections.
  • Description: corrected.

1. FAIMS test: fixture 19 (commit 796ecef)

Fixture 19 is fixture 8 recorded at two compensation voltages, −45 V and −60 V, with one MS1 spectrum per CV at every RT. The identifications refer to −45 V spectra.

  • Join CV check: LVNELTEFAK's heavy channel exists only at −60 V, where it is detected as a partial multiplet of its own. It is not joined to the light one at −45 V. With both channels at −45 V (the samecv input), it is joined with fixture 8's values.
  • CV match in blacklistSpectrum_: TLSDYNIQK's heavy channel at −45 V is re-quantified from weak heavy peaks there (H/L 0.25). The −60 V partial reserved peaks at the same m/z and RT, and they do not count at −45 V.
  • Targeted candidate.cv: AEFVEVTK is never detected. It is measured at −45 V, the CV of its identification, and its heavy channel is absent there (0); it is not measured from the −60 V spectra. With the heavy channel at −45 V, it is measured: H/L 1.
  • Owner arrays from one FeatureFinderMultiplex run per CV: _19_faims_owners passes only if both detections deliver owner arrays. It also pins that peaks reserved at −60 V veto nothing at −45 V, with owners or without.
  • The 8 tests: _19_faims_split (+ _out1), _19_faims_owners, _19_faims_samecv (+ _out1), _19_faims_targeted (+ _out1), _19_faims_samecv_targeted.
  • One change from the suggested assertion: the join writes its log line only when it joins or rejects a candidate, so in this test 0 partial multiplet(s) were found… is not printed. Instead, _19_faims_split fails if the join line appears at all.

Mutants, each removing one CV check:

CV check removed tests that fail what goes wrong
M1 join candidate split, split_out1, owners, samecv, samecv_out1, targeted_out1 the −60 V partials become candidates
M2 blacklistSpectrum_ split, split_out1, samecv_out1, targeted_out1 TLSDYNIQK heavy becomes NaN
M3 targeted spectrum filter targeted, targeted_out1 AEFVEVTK heavy measured from −60 V
M3b candidate.cv not set targeted, targeted_out1, samecv_targeted no spectra, no feature
M4 re-quantification spectrum filter split_out1, samecv_out1, targeted_out1 TLSDYNIQK H/L ≈ 1 instead of 0.25
M5 resolver owner check split, split_out1, owners, samecv_out1, targeted_out1 −45 V channels vetoed by −60 V peaks
M5b resolver plain blacklist check owners the same, without owners
  • Coverage: every test fails for at least one mutant.
  • Not covered: the CV checks in mergeFragments_ and attachToUndetectedChannels_ (both already in develop), and in targeted mode the CV parts of the checks against an already quantified peptide, another peptide's multiplet and unidentified multiplets.
  • Real data: no real FAIMS run was measured; the CV handling is pinned by this synthetic fixture only.

2. Runtime and memory of the default path

  • Result: at rt_band 0, +84.7 MiB max RSS (+3.4 %) and no measurable wall time. At rt_band 5, +147.4 MiB (+4.5 %), down from +678.4 MiB.
  • Setup:
    • Data: one PXD022659 run (C_0-5ug_DDA_099, 15,290 MS1 spectra, 21.08 M MS1 peaks), with the workflow's parameters.
    • Develop: a3e7dea. Before: 81788e3, the head the review read. After: ec2143f, the compaction.
    • Measurement: one run at a time on an idle machine, wall time and max RSS from getrusage.
  • FFM = FeatureFinderMultiplex, workflow = MS1LabeledWorkflow.

Max RSS, 1 thread (develop, then the excess over develop)

develop before after
FFM, rt_band 0 2499.5 MiB +88.7 +84.7 (+3.4 %)
FFM, rt_band 5 3298.2 MiB +678.4 (+20.6 %) +147.4 (+4.5 %)
workflow, rt_band 0 2565.7 MiB +91.4 +84.5 (+3.3 %)
workflow, rt_band 5 3363.7 MiB +678.2 (+20.2 %) +148.0 (+4.4 %)

Wall time vs develop, 1 thread

before after
FFM, rt_band 0 0.992, 0.986 1.042, 0.999
FFM, rt_band 5 1.059 1.023
workflow, rt_band 0 0.952, 0.964 ¹ 0.903 ¹
workflow, rt_band 5 1.061 – ²

¹ The workflow is faster than develop only in the filtering step. That step is the same code as in FFM, where develop and this PR match, so this is not a gain from the PR.
² There is no develop run from the same session. The machine ran 8–11 % slower in the second session, so wall times are not compared across sessions. Max RSS repeats to about 1 MiB, also across sessions.

  • Time: at rt_band 0 the two FFM pairs gave 1.042 and 0.999, and the same develop binary varied by 5.6 %. At rt_band 5, filtering takes +44 s, where the version before the compaction took +89 s.
  • 4 threads instead of 8: the machine has 4 cores. These runs were made before the compaction. The compaction was compared with develop at 1 thread only; its identity check against the old head ran at 2 threads.
    • Memory: the excess was within about 5 MiB of the 1-thread excess (at most 5.2 MiB, FFM rt_band 5; FFM +89 / +673 MiB, workflow +90 / +674 MiB at rt_band 0 / 5).
    • Wall at rt_band 0: within noise (FFM 0.988, workflow 1.016).
    • Wall at rt_band 5: FFM 1.115 (CPU 1.075), workflow 1.044.
    • Outputs: identical at 1 and 4 threads.
  • Outputs:
    • FFM vs develop: the same features and multiplets after masking unique ids, at rt_band 0 (39,346 features, 27,279 multiplets) and rt_band 5, before and after the compaction.
    • Before vs after the compaction, full run, FFM: featureXML, consensusXML and the blacklist mzML with the owner arrays are byte-identical, at rt_band 0 and 5.
    • Before vs after the compaction, workflow: at rt_band 0, identical apart from the build-date version string. At rt_band 5, the logs and their counts are identical.
    • Workflow vs develop: different by design. At rt_band 0 the PR joins 106 partial multiplets and reports 8,709 consensus features (develop: 8,798).
  • Where the remaining memory goes:
    • Dense owner array, 80.4 MiB: one int (4 B) for each of the 21.08 M MS1 peaks above the cutoff. It is the same at every rt_band.
    • Records, at rt_band 5: 67 MiB more for the records of peaks reserved more than once and for the list of accepted filtered peaks.
    • Provisional ids and the two owner arrays (2 × 62 MiB at rt_band 5): they are allocated after the peak, so they do not raise it.
    • The peak itself: a short spike at the end of filtering, which develop has too (+296 MiB at rt_band 0, +527 MiB at rt_band 5). This PR does not touch it.
  • What the compaction changes:
    • The hash map of first owners is gone. A 12-byte record is kept only for peaks that more than one filtered peak reserved.
    • A writer takes 12 bytes instead of 24.
    • Owners are converted one spectrum at a time instead of as one full copy.
  • Commits:
    • The compaction is ec2143f.
    • The direct owner test is 97cdad4. It reserves peaks by hand, with three writers on one peak, and checks which owners are kept: the first writer with its mass trace and the last writer, not the one in between. It also checks them through the per-spectrum accessor.

3. Q A: one heavy partial spanning two light partials

  • Result: it happens, but rarely, and the peptide ratio stays right. It is now documented; the code is unchanged.
  • How often: once in 470 distinct accepted joins (one run per dilution point and the 1:1 three-run set, without duplicates).
  • The observed case: run D_098, YFILPDSLPLDTLLVDVEPK 2+. The two light partials are not split in RT. One light elution was split in m/z: its centroid jitters from spectrum to spectrum, and L2 lies 8.1 ppm from L1, outside the 6 ppm detection tolerance. H was joined to L1.
  • Effect: the peptide ratio comes from L1 + H and is unaffected. The summed channel abundances miss R × I(L2) in the heavy sum.
  • Decision: documented in the join's doc (97791b5; its example of a split elution was corrected to this m/z case in 74e3926). A fix would need an m/z criterion looser than the detection tolerance, such as id_mapping:mz_tolerance. The join does not use that tolerance: at 20 ppm, the first join attempt took wrong partners (_9_join_tolerance pins this).

4. Q B: owners in the middle are not kept

  • Result: at the default rt_band 0 it did not occur on a full run. At rt_band 3 it changed none of the vetoes and re-quantified values checked. It is now documented; the code is unchanged.
  • What it needs: three writers (filtered peaks) in the order dropped → reported → dropped. They do not have to be three patterns: in 402 of the 630 cases below they came from one or two.
  • rt_band 0, full run C_028:
    • 1,099,702 blacklisted peaks: 17 with two writers, 0 with three or more, 0 lost.
    • This is a measured result, not a guarantee.
  • rt_band 3, half a run (RT 3000–7000 s):
    • 630 of 2,813,129 blacklisted peaks (0.022 %) lose their reported owner, on 202 of 29,328 reported features.
    • Six partial multiplets have a re-quantification window that touches such a peak. In all six, other foreign-owned peaks already make that channel not quantifiable. This holds with the recorded owners and with "first reported writer" owners alike.
    • No veto flips in the 7 multiplets checked (the six, plus one of three whose resolver window touches such a peak; the other two were not checked), so no re-quantified value changed. The join and targeted paths were not checked.
  • Decision: documented (97791b5). Recording every writer would cost memory for no observed effect. The owner test 97cdad4 (section 2) pins which writers are kept.

5. CodeRabbit: no elution-profile criterion in the join

  • Result: on real data, an elution-profile criterion does not tell good joins from bad ones. The m/z tolerance and the re-measurement do. [FIX] MS1LabeledWorkflow: require the isotope pattern for paired channel intensities #10786 adds an isotope-pattern check.
  • Why there is no elution criterion:
    • On PXD022659, the first join attempt was scored good (≤ 1.5×) or bad (> 2×). The correlation of the two channels' XICs separates the two groups with AUC 0.56, where 0.5 means no separation. XIC overlap reaches 0.57 and the apex distance 0.53.
    • The bad ratios came from intensities measured over different scans. In 190 of the 191 joins more than 2× off, the weaker channel was the one with the narrower hull.
    • Re-measuring both channels over their common spectra fixes this.
  • How accurate the joins are:
    • On the 1:1 three-run set, the join adds 214 cells, 99.1 % of them within 1.5× of the median; 3 cells are lost.
    • After re-measuring, the first attempt still had 7–11 of 487 joins more than 2× off. Correlation does flag these (AUC 0.87). They fell into three groups:
      • abundant other species 14–18 ppm away, let in by the 20 ppm ID-mapping tolerance (the join now uses the detection's 6 ppm);
      • partners at a single-label shift, from the K+R residue bug that this PR fixes (section 4 of the description);
      • interference with low correlation.
  • Tests that pin rejections:
    • TOPP_MS1LabeledWorkflow_9_join_channels: a heavy partial identified as another peptide (VLNELTEFAK next to LVNELTEFAK) is not joined.
    • _9_join_tolerance: a candidate 15 ppm off is not joined; the 20 ppm ID tolerance would have taken it.
    • _10_join_channels: channels that share only five spectra are not joined (the minimum is 6).
    • _19_faims_split: a partial at another CV is not a candidate.
  • What [FIX] MS1LabeledWorkflow: require the isotope pattern for paired channel intensities #10786 adds:
    • A candidate is joined only if its re-measured channel shows its isotope pattern in at least 2 paired spectra.
    • _17_join pins this: a candidate whose heavy peaks are another envelope's isotopes is rejected; before, it was joined at H/L 1.19.
    • On the dilution series (21 runs), the check rejects 10 of 806 joins.

6. Description

  • Same-peptide owners: fixed in the body. Foreign owners are unidentified multiplets, other identified peptides and another multiplet of the same peptide (isForeign()).
  • Targeted runtime: the body now names the baseline. It is this PR with defaults (targeted off): 24:40 vs 24:05 min for the three 1:1 runs in one call at 1 thread. That is +2.4 %; the body said +2.5 %.
  • Runtime and memory: the body has a new section with the numbers above.

Generated by Claude Code

@timosachsenberg
timosachsenberg merged commit 3aa7bc2 into develop Nov 2, 2026
29 checks passed
@timosachsenberg
timosachsenberg deleted the claude/issue-10782-silac-coverage branch November 2, 2026 17:05
timosachsenberg pushed a commit that referenced this pull request Nov 2, 2026
#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
timosachsenberg pushed a commit that referenced this pull request Nov 2, 2026
…ges natively

Conflicts and ports:
- QcMLFile.cpp: removed with qcML (#10736).
- FeatureFinderAlgorithmMetaboIdent (#10765): with FAIMS, a target without
  features is kept once (by PeptideRef), without a CV, and only if no CV
  group found it. Its class test checks that now.
- FeatureFinderIdentificationAlgorithm (#10787): the candidates of all CV
  groups are written together (appendFeatures, annotated with their CV);
  runOnCandidates post-processes FAIMS candidates per CV, each group with the
  identification data of the candidates, and erases the features no group
  keeps with the identifications only they link.
- FeatureOverlapFilter::mergeFAIMSFeatures (#10765): features identified as
  different peptides are not merged (first linked match), and the merged
  feature takes over the links of the other once per spectrum and run.
- MultiplexResolverAlgorithm (#10783): owner-aware blacklist;
  ownerPeptides() reads the first linked identification, peptideKey() takes
  the sequence (as AASequence::toString() writes it) instead of a PeptideHit.
  Develop's new tests build their identifications as identification data.
- MS1LabeledWorkflow (#10783): joining separately detected channels and the
  targeted quantification work on the linked and unassigned identifications;
  identifications move with MS1LabeledIdentifications::moveIdentifications().

Reference outputs: MS1LabeledWorkflow_2, _11_targeted_mbr, _13_targeted_mbr,
ProteomicsLFQ_3 and ProteomicsLFQ_3_seedRT are develop's files with the
unassigned peptide identifications in the order this branch writes them
(run by run, by query ID); the identifications and all other lines are
equal (compared block by block), as before the merge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01B51nRFoHvZuVXD7cT8XZav
timosachsenberg pushed a commit that referenced this pull request Nov 3, 2026
Conflicts with #10783 (owner-aware blacklist) resolved by carrying its owner
tracking into this branch's restructured code:

- MultiplexFiltering::filterSpectrum_(): peaks are still moved into the
  result; the serial path blacklists before the move with the index the peak
  gets (result.size()), the parallel path calls applyBlacklistEntries_() after
  adding the peak (result.size() - 1), as on develop.
- FeatureFinderMultiplexAlgorithm: the parallel multiplet construction
  (buildAndAppendMultiplets/appendMultiplet) now records, per reported
  cluster, the provisional id of each channel's feature in multiplet_ids, the
  same ids develop's serial loop recorded, for provisionalOwners().

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmbcSsYjLfL6414Qei7
timosachsenberg pushed a commit that referenced this pull request Nov 24, 2026
… default, never on a pair the join rejected

Measured on PXD039580 (HeLa triple SILAC, 6 runs, ProSE IDs) and PXD003327
(E. coli, runs 1-2-4 and 4-1 with an absent medium channel):

- 'all' and 'not_join_rejected' added 1202 and 1176 of 185035 cell ratios on
  PXD039580; the new ones were as accurate as the re-quantified ones of develop
  (M/L 92 vs 85 %, H/L 82 vs 81 % within 1.5x), on PXD003327 11 (all within
  1.5x of their class median), and no false medium value in the absence control.
- The 26 ratios that only 'all' adds come from pairs the join examined and
  rejected. The join's six-spectra minimum was calibrated for them (#10783), and
  on fixture 10 such a pair gives H/L 0.46 for a 1:1 peptide, so those pairs
  stay excluded and the option becomes a plain switch.
- With 'false' the output is identical to develop on all 8 runs; run time and
  memory are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL
timosachsenberg added a commit that referenced this pull request Nov 26, 2026
…dentified multiplets that can be the peptide (#10988)

* [FEATURE,PARAM,TEST] MS1LabeledWorkflow: re-quantify channels vetoed only by unidentified multiplets that can be the peptide

A missing channel at whose position the detection reserved peaks for another
multiplet is made not quantifiable by the resolver before it is measured. When
that other multiplet is unidentified, it is often the missing channel itself,
detected on its own, and its peaks are otherwise dropped. The new advanced
option -requantify_vetoed (none, not_join_rejected, all; default none for now)
measures such a channel with the re-quantification's rules (pattern in at least
two spectra, M-1 bound, co-elution check) from those peaks too, if every
multiplet reserving peaks in the resolver's check window is unidentified and can
be the peptide (same charge and CV, all channels at the peptide's channel m/z,
the rule the targeted quantification already uses). A multiplet identified as
another peptide or as the same one (quantified itself; #10783 made that foreign
to avoid counting it twice) keeps the channel not quantifiable.
'not_join_rejected' also leaves channels whose occupant the join examined and
rejected (fewer than six paired spectra), as on synthetic data a rejected pair
gives a wrong ratio (fixture 10: H/L 0.46 for a 1:1 peptide).

- MultiplexResolverAlgorithm::reservingOwners() returns the owners in the check
  window; isReservedByOther_() uses it, unchanged in behaviour.
- The may-be-the-peptide check of the targeted quantification becomes
  mayBePeptide_() and unidentifiedChannels_(), shared by both paths.
- joinChannelsOfIdentifiedPeptides_() reports the pairs it rejected.
- With match_between_runs, an unidentified multiplet kept for linking whose
  peaks gave such a value is removed, as for the targeted quantification.

Tests: class test of reservingOwners(); TOPP tests on fixtures 8 (without the
join, 'all' gives the join's H/L) and 10 (not_join_rejected vs all).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL

* [PARAM,TEST] MS1LabeledWorkflow: -requantify_vetoed true/false, on by default, never on a pair the join rejected

Measured on PXD039580 (HeLa triple SILAC, 6 runs, ProSE IDs) and PXD003327
(E. coli, runs 1-2-4 and 4-1 with an absent medium channel):

- 'all' and 'not_join_rejected' added 1202 and 1176 of 185035 cell ratios on
  PXD039580; the new ones were as accurate as the re-quantified ones of develop
  (M/L 92 vs 85 %, H/L 82 vs 81 % within 1.5x), on PXD003327 11 (all within
  1.5x of their class median), and no false medium value in the absence control.
- The 26 ratios that only 'all' adds come from pairs the join examined and
  rejected. The join's six-spectra minimum was calibrated for them (#10783), and
  on fixture 10 such a pair gives H/L 0.46 for a 1:1 peptide, so those pairs
  stay excluded and the option becomes a plain switch.
- With 'false' the output is identical to develop on all 8 runs; run time and
  memory are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL

* [FIX,TEST] MS1LabeledWorkflow: one vetoed channel per unidentified signal in -requantify_vetoed

Review finding: the values of vetoed channels were applied one multiplet at a
time, so two identified multiplets of one peptide that the detection found
separately (e.g. the light and the medium channel, without the join) could
both measure their missing heavy channel from the same unidentified heavy
multiplet's peaks. In a run, both features carry the same peptide identity, and
the protein and peptide abundances would add the shared signal twice.

The values are now collected first and applied afterwards: a value that read
the reserved peaks of an unidentified multiplet's channel that another vetoed
channel's value read as well is dropped, and that channel stays not
quantifiable, as the resolver treats a channel on another multiplet of the same
peptide. The log line counts these channels.

Test: MS1LabeledWorkflow_24, a synthetic triple SILAC run (generator
committed) with LVNELTEFAK detected as three separate channels, the light and
the medium one identified. Without the join, both heavy channels stay not
quantifiable (before: two heavy values of the same signal); with the join, the
three channels form one multiplet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL

* [FIX] MS1LabeledWorkflow: read the re-quantified channel list with toIntList() (MSVC)

MSVC rejects constructing an IntList from a DataValue (ambiguous vector
constructor) in the code that applies the values of vetoed channels.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL

* [FIX,TEST] MS1LabeledWorkflow -requantify_vetoed: use only the unidentified multiplet's channel at the missing channel's m/z; targeted quantification does not read those peaks again

From the CodeRabbit review:

- A vetoed channel could use the reserved peaks of every channel of an unidentified multiplet that can
  be the peptide, including another channel's isotopes at its position, e.g. a light-only multiplet's
  M+4/M+5 read as the Lys4 channel's M0/M+1 (5 ppm apart at m/z 1166). Now only that multiplet's
  channel at the missing channel's m/z (detection tolerance) may be read. If none of the multiplets has
  a channel there, the channel is not measured; the log counts it as "on another channel's isotopes
  of an unidentified multiplet" (new VetoedChannel_::OTHER_CHANNEL).
- The targeted quantification treats the reserved peaks of an unidentified multiplet's channel that a
  re-quantified channel already read as occupied, so that one signal is not counted for two
  (isobaric) peptides.

Test: MS1LabeledWorkflow_26 (generator committed), SVEDLAFGNYQGEDVTALFEK 1:0:1 with light and heavy
detected separately, heavy identified, medium absent, without the join: the light is measured from the
light multiplet (L = H) and the medium stays not quantifiable. Before, the medium was measured from the
light M+4/M+5, and both values were then dropped as reading the same multiplet's peaks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL

---------

Co-authored-by: Claude <[email protected]>
timosachsenberg added a commit that referenced this pull request Nov 26, 2026
…t only if other channels' isotopes are half of it; reference from two spectra where none gives three (#10997)

* [FEATURE,TEST] MS1LabeledWorkflow targeted quantification: leave a peak out only if other channels' isotopes are half of it; a reference from two spectra where no identification gives one from three

Two thresholds of the targeted quantification (#10783), neither calibrated on data so far:

- A channel's peak that holds an unresolved isotope of a lower channel (e.g. the light M+4 in a Lys4
  or Dimethyl4 channel) is now left out only if that isotope's estimated part is at least half of the
  peak (was 20 %); below that the part is subtracted, as it already was below 20 %. The bound stays
  because it is the only guard against an unrelated peak at a lower channel's m/z, taken for that
  channel, whose "isotopes" would take away the channel's peak (fixture 15, SVEDLAFGNYQGEDVTALR: the
  heavy would become absent). The 20 % rule mostly hit Lys4 channels under a light channel several
  times stronger (PXD039580 Mix1, L:M = 70:15), whose medium M0 holds 20-50 % light M+4.
- The identified channel (the reference) still needs its first two isotopes, without a strong peak
  one isotope below, in three spectra. An identification that gets no feature that way, and lies in no
  feature measured from another identification of its peptide, is then measured with two
  (min_pattern_spectra_, as many as every channel measured against the reference needs). Lowering the
  minimum to two in one pass let a weak identification that comes first in RT take the peptide's
  feature from a later, better one: on PXD039580 224 ratios were lost that way (e.g.
  SGLSSPIYIDLR: an Arg10 identification measured from two spectra instead of the Arg6 one,
  without a light value).

Tests:
- Fixture 15: in each of its three references exactly one value changes:
  TALFEQLSVEDLAFGNYQGDR 1:2:1, whose heavy M0 holds 26 % medium M+4, gets H/L 1.000 (light and
  medium identification) and 1.011 (heavy identification) instead of not quantifiable. Comments and
  log regexes updated.
- New fixture 25 (generator committed), triple SILAC Lys4:
  - a medium with 30 % light M+4 is measured (M/L 0.370 for 1/2.7), one with 65 % stays not
    quantifiable;
  - a weak light identification with its first two isotopes in two spectra is quantified
    (M/L, H/L 2.000);
  - YVNDLAGHEK, identified in its weak medium 3 s before the apex and in its light 2 s after it:
    the light identification gives the feature (L 4.59e7; a one-pass minimum of two gives the medium
    one's, L 6.97e6).
  It fails with develop, with the one-pass version, and with the mutants threshold 0.25, threshold
  0.7 and three reference spectra only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL

* [FIX] MS1LabeledWorkflow: do not capture a structured binding in the targeted measuring lambda (clang with OpenMP)

clang rejects capturing a structured binding in a lambda when OpenMP is enabled ("capturing a
structured binding is not yet supported in OpenMP"); the group is now a plain reference. Checked
with clang++-18 -fopenmp -fsyntax-only, which reproduces the CI error before and passes after.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL

* [FIX,TEST] MS1LabeledWorkflow targeted quantification: a reference from two spectra ranks last and cannot report a channel absent

Review of the two-pass reference minimum:

- One signal, one peptide: a peak measured from fewer reference spectra (second pass) now ranks after
  all others, so an identification with a better score but a reference from two spectra cannot take
  the signal from a peak measured from more (e.g. isomers, one identified in a weak channel).
- Next to such a reference a channel without a peak is not quantifiable instead of absent: a channel
  seen in two spectra only cannot tell a weaker channel's absence. On PXD039580 (every channel at
  least 15 %) the second pass had raised the absent targeted channels from 9,346 to 11,748; ratios do
  not change, since a ratio needs both channels > 0, but the zeros entered the summed abundances.
- Only identifications that failed for the reference minimum alone (their identified channel has its
  first two isotopes in two spectra) are measured again (new TargetedOutcome_::FEW_REFERENCE_SPECTRA),
  not every one without a peak.
- Help text reflowed.

Fixture 25 gains SAGLDFVEEK 1:0:0 (weak light, medium and heavy not quantifiable instead of 0) and
the isomers ADLTVEFGNK (light, PEP 1e-4, weak) / DALTVEFGNK (heavy, PEP 1e-3, strong) on one signal
(the heavy identification's peak is kept: H/L 6.0, L 1.23e7 instead of 1.74e6). The test fails with
develop and with the previous head.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL

* [FIX,TEST] MS1LabeledWorkflow targeted quantification: a window of two spectra reaches the second pass

From the CodeRabbit review: the early guard returned NO_SIGNAL for a window with fewer spectra than
the first pass's reference minimum (3), so a window of exactly two spectra never became
FEW_REFERENCE_SPECTRA and was never measured with two. The guard now uses min_pattern_spectra_ and
leaves the decision to the clean-spectrum check. Practically only a run edge or a very sparse MS1
acquisition leaves two spectra within +/- 'algorithm:rt_typical'.

Fixture 25 gains GSAEVTLDFK 1:1:1 in the two spectra at 700 and 701 s only: its light is measured
(before: not quantified for want of a clean elution peak), medium and heavy not quantifiable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL

* [FIX,TEST] MS1LabeledWorkflow targeted quantification: co-elution needs three spectra; fixture 25 regex and scan references

From the CodeRabbit review of 4e0bca9:

- A channel measured against a reference counts as co-eluting only over at least three spectra of the
  elution peak. With two, the Pearson correlation of the isotope-summed profiles is +/-1 whatever the
  channel's course, and the second pass (a reference from two spectra) can leave an elution peak of
  two spectra. With three reference spectra (first pass) the peak always has three, so nothing changes
  there.
- The fixture 25 log regex held a ';', which CMake splits into two alternatives; it is now '..', as in
  the other tests.
- The generator derives each identification's spectrum reference from the list of spectrum times
  (GSAEVTLDFK at 700.5 s is scan 562, not 601).

Fixture 25: GSAEVTLDFK's apex moves to 700.3 s, so its two spectra differ; medium and heavy were
accepted at 1:1:1 from the two spectra before and are not quantifiable now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL

* [FIX] MS1LabeledWorkflow targeted quantification: a feature that reports no value replaces no multiplet kept for match between runs

The owners of reserved peaks read in the identified channel were recorded whenever the feature was measured, also if it reports
no channel (its own intensity not quantifiable, the others not quantifiable or absent). With -match_between_runs true, such a
feature removed the unidentified multiplet it read, so that run lost the value linking would have given the multiplet, while the
feature has none to give. The reference's owners are now recorded only if some channel is reported, as the comment above the loop
and the replacement's documentation say ("so that run gets the targeted value instead"). The documentation now says that the
replaced multiplet is the one whose peaks entered one of the feature's values.

This is rare: 5 of 16,458 targeted features of one PXD039580 run (8 of 15,053 on develop) report no channel, and the change has an
effect only with match between runs, which the benchmark runs do not use. The MS1LabeledWorkflow and Multiplex tests are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL

* [FIX,TEST] MS1LabeledWorkflow targeted quantification: co-elution needs the identified channel's peaks in three spectra, not an elution peak of three

a3969b2 required the elution peak to span three spectra (last - first >= 2) before another channel's co-elution with the
reference is tested. The elution peak is that of the smoothed sum over the channels, trimmed where the smoothed sum is positive,
so it reaches past the spectra with signal: a peptide whose peaks lie in two spectra amid spectra every second gets an elution
peak of four or more. Its other channels were then correlated over the two spectra with signal and empty ones around them, and
that correlation barely depends on their course (e.g. [0, 5, 5, 0] against [0, 9, 1, 0] gives 0.66, above the default 0.5).

The condition now counts the spectra of the elution peak in which the identified channel has a peak (its isotope-summed profile,
the one the correlation uses, is positive), min_coelution_spectra_ = 3. A first-pass reference has its first two isotopes in at
least three spectra, so the first pass is unchanged (as on develop); only a reference from two spectra (second pass) whose
channel has no peak in a third spectrum is affected, and its other channels are then not quantifiable. The tested channel's own
peaks are not counted: where the reference has a peak and the channel none, the channel's zero is evidence the correlation uses
(a weak channel in two of three spectra is accepted on develop's first pass, and stays so).

Fixture 25 gets NEFLGSVDYK 1:1:1, all its peaks in the two spectra at 580 and 581 s amid spectra every second: a3969b2 measures
its medium and heavy (10 channels measured, 5 not quantifiable), now they are not quantifiable (8 measured, 7 not quantifiable).
The help text says that the other channels of a reference with peaks in fewer than three spectra are not quantifiable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL

* [FIX] MS1LabeledWorkflow targeted quantification: record the owners of the identified channel's peaks the reference was taken from

If the subtraction of the other channels' isotopes leaves the identified channel too few spectra, its peaks as measured
(own_measured) are the reference (own_as_measured). The owners of reserved peaks were still recorded only where the subtracted
peak (intensity[own]) is positive; where the subtraction leaves 0, a peak that entered the reference kept its owner unrecorded,
so with -match_between_runs true the unidentified multiplet it belongs to stayed next to the targeted feature measured from it.
The identified channel's check now uses own_peaks, the peaks the reference was taken from; without the fallback that is
intensity[own], so nothing else changes. Like 719c4e5 this has an effect only with match between runs (present on develop).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL

* [FIX,TEST] MS1LabeledWorkflow targeted quantification: co-elution needs signal at 10 % of the reference's height in three spectra; only a feature that gives a ratio replaces a multiplet kept for match between runs

Review of a939d49 (two medium findings):

1. 0cca54d counted every spectrum in which the identified channel has a peak towards min_coelution_spectra_. One low peak in a
   third spectrum then satisfied it, and the correlation was still decided by the two spectra of signal: [0, 5, 5, 0.1, 0] against
   [0, 9, 1, 0, 0] gives 0.70 for a channel whose course is the opposite of the reference's. A spectrum now counts only if the
   identified channel's isotope-summed profile there is at least 10 % of its maximum (coelution_height_fraction_), i.e. within
   the elution peak's width at 10 % of its height, the height at which chromatography measures a peak's asymmetry. LVNELTEFAK
   (M0 in six spectra, M+1 in two) still qualifies. Fixture 25's NEFLGSVDYK gets one low peak (4 % of its apex) at its light M0
   at 582 s: a3969b2 and a939d49 both measure its medium and heavy from the two spectra (10 measured, 5 not quantifiable),
   now they are not quantifiable (8, 7); its features are unchanged.

2. A feature that reports only its identified channel gives no ratio, and withholdIncompleteTargeted_() also takes it out of the
   abundances (fewer handles than channels). With -match_between_runs true it still recorded the owners of the reference's
   peaks and so removed the unidentified multiplet it read, losing the value linking would have given it (the case 719c4e5
   meant to exclude). The second pass makes such features common (no absent channel, no co-elution from two spectra). Owners are
   now recorded only if the feature gives a ratio: two channels with a value, one of them > 0. No test covers the match between
   runs owner changes (719c4e5, a939d49, this one): raising algorithm:peptide_similarity on fixture 11 to make its targeted
   VLDELTLAR feature report one channel also stops its doublet from being kept for match between runs.

Help text and doxygen updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL

* [FIX] MS1LabeledWorkflow targeted quantification: the 10 % height condition on co-elution applies to references from two spectra only

622474c counted, for every reference, only spectra in which the identified channel's profile reaches 10 % of its maximum.
Measured on all four data sets, that also changed develop's first pass, where a reference shows its first two isotopes in three
spectra: on PXD039580 it removed 168 of develop's ratios (190 lost instead of 22; the 190 within 1.5x: M/L 85.7 %, H/L 83.5 %),
on PXD003327 4 (triplex) and 3 (duplex), with no false value in the absence control either way. Compared with 0cca54d it
removed 405 ratios that were 92.6 % (M/L) and 89.1 % (H/L) within 1.5x.

The finding it answers is about references from two spectra (second pass), whose third spectrum may hold only a low peak. The
condition now applies to them only; a first-pass reference keeps develop's co-elution test (every spectrum with a peak of the
identified channel counts, and it has three). Fixture 25's NEFLGSVDYK (second pass) still pins it. A sharp first-pass peak
with weak clean tails has the same near-degenerate correlation on develop; changing that is left to a change of its own,
since these data show no error it causes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL

* [FIX] MS1LabeledWorkflow targeted quantification: a feature replaces a multiplet kept for match between runs if it gives a ratio or abundances

622474c let a targeted feature replace the unidentified multiplet it read if two of its channels have a value and one is > 0.
That is not what the ratios and abundances use (CodeRabbit on 6d789c9): MS1LabeledRatioQuantifier forms a channel's ratio
against '-ratios:reference_channel' from positive channels only, and withholdIncompleteTargeted_() takes a feature with a
not-quantifiable channel out of the abundances. So [NaN, 10, 20] (reference light) or [10, NaN, 0] contribute nothing but
replaced the multiplet, while [10, 0, 0] contributes complete abundances. The feature now replaces it if it gives a ratio (its
reference channel and another one > 0) or abundances (every channel with a value, one > 0). Only match between runs is
affected; documentation updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL

* [FIX,TEST] MS1LabeledWorkflow targeted quantification: estimate a lower channel's isotopes from that channel's own isotope distribution

Review of 77484d8 (medium): a lower channel o's part of a channel's peak was estimated as o's M0 times I_k/I_0 of the
identified peptidoform's isotope distribution. A 13C or 15N label replaces natural atoms ((13)C and (15)N are single isotopes
in ElementDB), so for a Lys8 or Arg10 identification that distribution has six natural carbons (and two or four natural
nitrogens) fewer than the light channel whose M+4/M+5 is subtracted: I_4/I_0 is 15-30 % too small. Under the 20 % bound that left
a channel at most 4-8 % too high; under the 50 % bound it is up to 17-31 %, and the value depends on which channel was
identified, which the design avoids ("the same data give the same values whichever channel was identified").

Every channel now has its own formula (channelFormulas_()): the identified formula with its own channel's labels replaced by
that channel's, from the label sets of MultiplexResolverAlgorithm::expectedChannelMZs() and the labels' diff formulas
(ModificationsDB, collected with the labels). isotopes_of_others uses the lower channel's distribution; the identified
channel's (unchanged) still checks the isotope pattern. A label without a known composition (a plain mass shift) keeps the
identified distribution for all channels, as before.

Tests:
- New TOPP_MS1LabeledWorkflow_25_heavy_id (MS1LabeledWorkflow_25_heavy_id.idXML, written by the generator): SVEDLAFGNYQGEDVTALFEK
  identified in its heavy channel gives M/L 0.370 and H/L 0.371, as the light identification; 6d789c9 gives 0.387 and 0.375,
  which its FuzzyDiff rejects.
- Fixture 15: light, medium and heavy identifications now give the same values to 1e-7. The heavy references changed (H/L
  1.0015 -> 1.0000 for SVEDLAFGNYQR, 1.011 -> 1.0002 and M/L 2.006 -> 1.9997 for TALFEQLSVEDLAFGNYQGDR, Dimethyl8 having two
  natural carbons fewer), the light and medium ones by up to 1.4e-4 relative (the Dimethyl4/8 channels' own distributions); every
  changed element belongs to SVEDLAFGNYQR, SVEDLAFGNYQSVEDLAFGNYR or TALFEQLSVEDLAFGNYQGDR and their protein groups.
- Fixture 25's light reference changes by up to 1.2e-4 relative in the heavy channel (the medium's Lys4 distribution).
- The version string in the regenerated references is the one the other references carry.

ctest -R "MS1LabeledWorkflow|Multiplex": 218/218.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmZQDs13kYBVS1Gu2YL

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MS1LabeledWorkflow: SILAC ratio coverage (owner-aware blacklist, separately detected channels, targeted quantification)

2 participants