Repository navigation
Add a ppm-scale consensus merge as an option - #35
Open
percolator wants to merge 1 commit into
Open
percolator wants to merge 1 commit into
percolator wants to merge 1 commit into
Conversation
The consensus merge comes from MS-Cluster (MSClusterMerge), and so do its tolerances: 0.34 Th within a spectrum and 0.22 Th across a cluster. They were written for ion-trap data and are two orders of magnitude wider than the few ppm at which replicate fragments agree on Orbitrap data. Each join moves an intensity-weighted centroid, so a consensus peak can land where no member spectrum recorded one: 21.8% of peaks on a PXD002370 sample, 20.7% of the 20 most intense. The new merge groups peaks on a ln(m/z) scale, never joins two peaks of the same spectrum, and segments a group that would hold two peaks from one spectrum by dynamic programming over m/z. The binomial occurrence weight is kept. On the same sample it invents no peaks. Off by default: --consensusMethod ppm selects it, --consensusPpmSigma and --consensusMaxPeaks tune it. The default path is byte-identical to before on all 1,427 clusters checked. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
percolator
force-pushed
the
ppm-consensus-merge
branch
from
September 18, 2026 19:47
a64e1b0 to
b3ed0ea
Compare
percolator
added a commit
to statisticalbiotechnology/quandenser-again
that referenced
this pull request
Sep 22, 2026
MaRaCluster's consensus merge inherits MS-Cluster's fixed Thomson tolerances, which on Orbitrap fragment spectra are two orders of magnitude wider than the few ppm at which replicate peaks agree, and which invent peaks: 16.3% of the consensus peaks of fraction 9 of PXD004863 lie more than 10 ppm from any peak of any member spectrum. statisticalbiotechnology/maracluster#35 adds a merge that groups peaks on a ppm scale instead; with it that share is 0.0%, over the same clusters and the same 10,545 consensus spectra. Three options are forwarded to MaRaCluster verbatim: --consensus-method, --consensus-ppm-tol and --consensus-max-peaks. The default is unchanged, and the default code path in MaRaCluster is byte-identical to before. The submodule moves to ppm-consensus-merge-a7180b0, that change backported onto the commit pinned here, so the container still builds against the pinned ProteoWizard. Once #35 is merged the submodule should move to upstream master, which needs the container's ProteoWizard step reworked. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D7vADr6Z93sRBvfNGHUwW6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
The consensus merge comes from MS-Cluster (
MSClusterMerge), and so do its tolerances: peaks within 0.34 Th are joined inside each spectrum, then the pooled peaks are joined again at 0.22 Th. Those were written for ion-trap data. On Orbitrap fragment spectra, replicate peaks agree to about 1.4 ppm, while 0.22 Th is 440 ppm at m/z 500.Each join moves an intensity-weighted centroid, so the surviving peak can land where no member spectrum recorded anything. Measured on PXD002370, the UPS1-in-yeast set of the Quandenser paper, nine Q Exactive runs:
A quarter of the strongest peaks in a consensus spectrum are at an m/z nothing measured. Charge-3 and charge-4 fragment isotopes, 0.33 and 0.25 Th apart, fall inside the join window.
What this adds
PpmConsensusMerge, off by default:ln(m/z)scale, so one tolerance holds at every mass;numSigmas_ * ppmSigma_apart, and any group that would still hold two peaks from one spectrum is segmented by dynamic programming over m/z, minimising within-group scatter over the single-peak variance plus a constant per group;No new dependencies: STL, plus the existing
MZIntensityPairandSpectrumHandler, reusingPeakWeightTablefromMSClusterMerge.h.Interface
--consensusMethodthomsonppmselects the new merge.msclusteris accepted as a synonym ofthomson--consensusPpmSigma--consensusMaxPeaksOn the
ppmpath the peak lists are not passed throughbinMZIntensityPairs, since that is the within-spectrum join the method exists to avoid.Evidence
A 3,000-cluster sample spanning the cluster-size range, from a PXD002370 run:
thomson21.8%,ppm0.0%--consensusMaxPeaks 0maracluster unit-testpasses, including a new case covering the ppm grouping, the charge-4 isotope pair the current tolerances collapse, the same-spectrum split and the occurrence weightRuntime is unchanged, about 42 s for the sample either way, most of it reading mzML.
In a separate evaluation on the full data set (Tide + Percolator, 1% FDR, high-resolution fragment bins), ppm grouping gave +3.0% PSMs on its own and dropping the peak cap +5.2%; an entrapment database showed the share of entrapment hits flat, so the gain is not FDR inflation.
Identifications
Both merges run over one clustering of PXD002370 (101,540 consensus spectra each), searched with Crux Tide against UPS1 + reviewed yeast and rescored with Percolator, 20 ppm precursor window, 0.02 Th fragment bins, 1% FDR:
thomson(default)ppm,--consensusMaxPeaks 0Same clusters and same precursors, so the difference is the merge and the peak cap alone.
How it was tested
Built on this branch's base with MaRaCluster's own
admin/builders/install_proteowizard.shtoolchain, on Ubuntu 22.04 with gcc 11. The unit tests pass and the sample numbers above reproduce byte-identically there and on the older toolchain this work was developed against.One thing to note for anyone building master today:
cmake/FindProteoWizard.cmakedoes not ask for zstd, but current ProteoWizard'slibpwiz_data_msdata_core.areferencesZSTD_compress,ZSTD_getErrorCodeand friends, so the link fails with undefined references. It is unrelated to this change and I worked around it with-DCMAKE_CXX_STANDARD_LIBRARIES="-Wl,--start-group -L<tools>/lib -l:libzstd-gcc11-mt-s.a -l:libzlib.a -Wl,--end-group". Happy to send that as a separate PR:install_proteowizard.shmakes plain-name symlinks for the Boost components only, so adding one for zstd and listing it inFindProteoWizard.cmakewould fix it properly.🤖 Generated with Claude Code