Skip to content

[PERF] OSW reading: Percolator peak groups by table scans, export aggregates only exported peak groups - #10609

Merged
jpfeuffer merged 3 commits into
developfrom
perf/osw-peakgroup-reading
Oct 19, 2026
Merged

jpfeuffer merged 3 commits into
developfrom
perf/osw-peakgroup-reading

Conversation

@timosachsenberg

Copy link
Copy Markdown
Contributor

Split out of #10559 (which is closed in favour of six PRs against develop). The commits are those of #10559, cherry-picked onto develop 89cbde6; only the CHANGELOG entries were moved into a commit of their own. The measurements below were taken in #10559 on the three Orbitrap Astral DIA runs of the ProteoBench entrapment set (32 threads), where #10559 at b84b51e passed the full CI.

What

Faster reading of OSW files in rescoring and export. Output is unchanged.

  • OpenSwathPercolatorScoring: reads the peak groups of an OSW file with one scan per table and joins and sorts them in memory, instead of one SQL join with an ORDER BY: 176 s instead of 219 s rescoring for 2.9 M peak groups. The previous query is kept as a fallback.
  • OSWFile::readOpenSwathExportRows: aggregates the transition intensities only for the exported peak groups instead of all of them (OpenDIA/OpenSwathExport result export: 30 s instead of 72 s).

Open from the review of #10559

CodeRabbit's nitpick on OSWFile.cpp (the per-feature aggregation does not check sqlite3_step errors) was not addressed in #10559.

Commits

  • 5cca50b [PERF] OpenSwathPercolatorScoring: read the OSW peak groups by table scans
  • 991e182 [PERF] OSWFile: aggregate transitions only for the exported peak groups
  • 69f2879 [DOC] CHANGELOG: osw peakgroup reading

Generated by Claude Code

timosachsenberg and others added 3 commits October 17, 2026 10:58
…scans

For ms1/ms2/ms1ms2 rescoring the peak groups were read with one query that
joins FEATURE, PRECURSOR, FEATURE_MS2 and FEATURE_MS1 and orders the result
by run, precursor, RT and feature id. For the 2.9 M peak groups of one
Astral DIA run SQLite scans FEATURE_MS2, looks every row up in the FEATURE
index (the ids are random), builds a covering index on FEATURE_MS1 on the
fly and sorts everything in a temporary B-tree: about 50 s, against 16 s
for reading the four tables front to back.

Read the tables one after the other, join them by feature id in a hash map
and sort the rows with the same key in memory. Join semantics are kept
(inner join with PRECURSOR and with the score table of the level, left join
with FEATURE_MS1 for ms1ms2, NULL as NaN); if a feature has more than one
row in a score table, where the SQL join would return every combination,
the original query is used.

Measured with OpenDIA on an Orbitrap Astral DIA run (600k precursors):
rescoring takes 176 s instead of 219 s, the result table is unchanged
(apart from the random feature ids).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
readOpenSwathExportRows() built the per-feature transition aggregates
(areas, apexes and annotations, joined with GROUP_CONCAT) for every peak
group in the file and then looked up the exported ones. With a q-value
filter the export keeps a small part of them: 1,474 of 2.9 M peak groups in
an Astral DIA run, for which 17 M FEATURE_TRANSITION rows were grouped.

If at most 100,000 rows are exported, run the same aggregation once per
exported peak group (FEATURE_ID = ?, served by the feature id index that the
export creates anyway); otherwise keep the single query over the whole
table.

Measured with OpenDIA on an Orbitrap Astral DIA run: the result export
takes 30 s instead of 72 s, and the result table, including the aggregated
columns, is unchanged apart from the random feature ids.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

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 54 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
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b31e4c31-5a26-4304-98b0-2a1eb0d8ee40
📥 Commits

Reviewing files that changed from the base of the PR and between 89cbde6 and 69f2879.

📒 Files selected for processing: 3
  • CHANGELOG
  • src/openms/source/ANALYSIS/OPENSWATH/OpenSwathPercolatorScoring.cpp
  • src/openms/source/FORMAT/OSWFile.cpp
  • 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

Comment @coderabbitai help to get the list of available commands.

@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.

Reviewed 69f28793 for substantive issues. No actionable findings in the table-scan joins or export aggregation changes. I checked the required versus optional score-table rows, duplicate-row SQL fallback, group-key construction, and the existing FEATURE_TRANSITION indexes used by the per-feature queries.

Build and Test and the pyOpenMS wheel workflow passed on this head. This was a static review; I did not rerun the tests or benchmarks locally.

@jpfeuffer
jpfeuffer merged commit fe02f3c into develop Oct 19, 2026
33 checks passed
@jpfeuffer
jpfeuffer deleted the perf/osw-peakgroup-reading branch October 19, 2026 08:07
timosachsenberg pushed a commit that referenced this pull request Oct 19, 2026
…#10301, #10611, #10606, #10608, #10609, #10617, #10610, #10578 ProSE Percolator rescoring, #10628)

Only CHANGELOG conflicted; both entries are kept. Develop's changes to FalseDiscoveryRate,
IDScoreGetterSetter, ConsensusMapMergerAlgorithm, FileInfo and ProSE work on the established
classes, which this branch keeps as they are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01B51nRFoHvZuVXD7cT8XZav
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.

3 participants