Skip to content

feat(qpx): split into diann + openmsconsensus subtools; add openms-consensus converter - #45

Merged
ypriverol merged 7 commits into
mainfrom
feat/qpx-openmsconsensus
Aug 6, 2026
Merged

feat(qpx): split into diann + openmsconsensus subtools; add openms-consensus converter#45
ypriverol merged 7 commits into
mainfrom
feat/qpx-openmsconsensus

Conversation

@ypriverol

@ypriverol ypriverol commented Aug 6, 2026

Copy link
Copy Markdown
Member

Summary

Restructure the shared bigbio/qpx module into subtools so one shared module serves both pipelines:

  • modules/bigbio/qpx/diann/ — the existing DIA-NN converter (qpxc convert diann), process renamed QPX_EXPORTQPX_DIANN (used by quantmsdiann).
  • modules/bigbio/qpx/openmsconsensus/new, QPX_OPENMSCONSENSUS running qpxc convert openms-consensus over an OpenMS consensusXML + SDRF (used by quantms DDA / LFQ+TMT).

Why a new subtool: the openms-consensus converter reads the consensusXML directly and resolves the correct run per PSM (map_index / id_merge_index / feature-element runs), so it avoids the OpenMS -out_qpx PSM run mis-assignment (OpenMS#9872) and duplicate PSMs (OpenMS#9871). Both subtools share the same output contract (qpx_output/* + *.h5mu + versions.yml).

Container bumped to qpx 1.1.1 (openms-consensus + structured modifications / localization scores).

Follow-up dependencies (flagged, not done here)

  1. qpx 1.1.1 must be released to BioConda/BioContainers before the 1.1.1--pyhdfd78af_0 container resolves (the build number may need adjusting to the actual biocontainers build). Currently 1.1.0 is the latest release.
  2. Real-data test fixture: the openmsconsensus real test needs a small consensusXML + SDRF zip hosted like the DIA-NN one (under the PRIDE pmultiqc example-projects), wired via params.test_data.proteomics.qpx.openms_consensusxml. Until then the real test is skipped (assume(...)) and only the stub test runs. The stale diann snapshot was removed so nf-test regenerates it (container/process-name changed).
  3. Consumers re-point after merge: quantmsdiann bigbio/qpxbigbio/qpx/diann (QPX_EXPORTQPX_DIANN); quantms installs bigbio/qpx/openmsconsensus and drops its local module.

Related: bigbio/qpx#237, bigbio/qpx#239, OpenMS#9871, OpenMS#9872.

Summary by CodeRabbit

  • New Features

    • Added support for converting OpenMS consensus data into QPX Parquet and MuData outputs.
    • Added configurable project accession and extra conversion arguments.
    • Added workflow metadata, version reporting, and stub-mode support.
  • Updates

    • Updated DIANN conversion to QPX 1.1.1 and renamed it to reflect its purpose.
  • Tests

    • Added stub-mode coverage for OpenMS consensus conversion, including output and version checks.

…nsensus

Restructure the bigbio/qpx module into subtools so it serves both
pipelines from one shared module:

- qpx/diann/          (was qpx/, process QPX_EXPORT -> QPX_DIANN) — DIA-NN
- qpx/openmsconsensus/ (new, QPX_OPENMSCONSENSUS) — OpenMS consensusXML

The openms-consensus converter reads the consensusXML directly (correct
per-PSM run via map_index/id_merge_index; no -out_qpx run mis-assignment,
OpenMS#9872), used by the quantms DDA (LFQ/TMT) pipeline. Container
bumped to qpx 1.1.1 (openms-consensus + structured modifications /
localization scores). Stale diann snapshot removed for regeneration.
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ypriverol, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

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

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5af2e3ac-77c9-4950-8459-a6284c97a1d6

📥 Commits

Reviewing files that changed from the base of the PR and between 1e37b91 and 59122b1.

📒 Files selected for processing (3)
  • modules/bigbio/qpx/diann/environment.yml
  • modules/bigbio/qpx/diann/main.nf
  • modules/bigbio/qpx/openmsconsensus/environment.yml
📝 Walkthrough

Walkthrough

The PR renames the DIANN QPX process and updates its container. It adds the QPX_OPENMSCONSENSUS process, environment, metadata, configuration, and tests for QPX and MuData conversion outputs. CI now discovers tests in nested modules.

Changes

QPX module extension

Layer / File(s) Summary
Rename and update the DIANN process
modules/bigbio/qpx/diann/*
The process and test selectors use QPX_DIANN. The workflow metadata uses qpx_diann. The QPX environment and container use version 1.1.1.
Add the OpenMS consensus process
modules/bigbio/qpx/openmsconsensus/environment.yml, modules/bigbio/qpx/openmsconsensus/main.nf
QPX_OPENMSCONSENSUS converts consensusXML and SDRF inputs with qpxc, generates QPX and MuData outputs, reports versions, and supports stub execution.
Document and test the OpenMS workflow
modules/bigbio/qpx/openmsconsensus/meta.yml, modules/bigbio/qpx/openmsconsensus/tests/*
Workflow metadata, process configuration, stub testing, output assertions, and version snapshot validation are added.
Discover nested module tests
.github/workflows/ci.yml
Changed-module detection searches upward for the nearest tests/main.nf.test file and removes duplicate test paths.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Nextflow
  participant QPX_OPENMSCONSENSUS
  participant qpxc
  participant MuDataGeneration
  Nextflow->>QPX_OPENMSCONSENSUS: provide consensusXML, SDRF, and project accession
  QPX_OPENMSCONSENSUS->>qpxc: convert consensus data
  qpxc-->>QPX_OPENMSCONSENSUS: produce QPX dataset
  QPX_OPENMSCONSENSUS->>MuDataGeneration: generate MuData file
  MuDataGeneration-->>QPX_OPENMSCONSENSUS: return MuData output
Loading

Possibly related PRs

Suggested labels: Review effort 3/5

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: splitting QPX into DIA-NN and OpenMS consensus subtools and adding the new converter.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/qpx-openmsconsensus

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.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
modules/bigbio/qpx/openmsconsensus/tests/main.nf.test (1)

13-22: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Keep an executable conversion test in CI.

Lines 21-22 skip the real-data test when no fixture parameter exists. Default CI then validates only stub artifacts. Add a small immutable consensusXML and SDRF fixture, configure its default URL, and remove this skip before downstream workflows rely on this module.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@modules/bigbio/qpx/openmsconsensus/tests/main.nf.test` around lines 13 - 22,
Add small immutable consensusXML and SDRF fixtures for the OpenMS conversion
test, configure the default value for
params.test_data.proteomics.qpx.openms_consensusxml to reference the fixture
archive, and remove the assume(zipUrl != null) skip in the test("Should convert
OpenMS consensusXML to QPX Parquet + MuData") flow so CI always executes the
conversion.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@modules/bigbio/qpx/openmsconsensus/environment.yml`:
- Around line 5-7: Pin the qpx dependency in the environment.yml pip
dependencies to an existing release, such as 1.0.2, so Conda execution is
reproducible and no longer installs the unconstrained latest version; keep it
aligned with the supported qpx release used by the workflow.

---

Nitpick comments:
In `@modules/bigbio/qpx/openmsconsensus/tests/main.nf.test`:
- Around line 13-22: Add small immutable consensusXML and SDRF fixtures for the
OpenMS conversion test, configure the default value for
params.test_data.proteomics.qpx.openms_consensusxml to reference the fixture
archive, and remove the assume(zipUrl != null) skip in the test("Should convert
OpenMS consensusXML to QPX Parquet + MuData") flow so CI always executes the
conversion.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 31e704c5-ce71-4739-a821-8ec5b6a85688

📥 Commits

Reviewing files that changed from the base of the PR and between 1c93e06 and 95646ca.

⛔ Files ignored due to path filters (1)
  • modules/bigbio/qpx/tests/main.nf.test.snap is excluded by !**/*.snap
📒 Files selected for processing (10)
  • modules/bigbio/qpx/diann/environment.yml
  • modules/bigbio/qpx/diann/main.nf
  • modules/bigbio/qpx/diann/meta.yml
  • modules/bigbio/qpx/diann/tests/main.nf.test
  • modules/bigbio/qpx/diann/tests/nextflow.config
  • modules/bigbio/qpx/openmsconsensus/environment.yml
  • modules/bigbio/qpx/openmsconsensus/main.nf
  • modules/bigbio/qpx/openmsconsensus/meta.yml
  • modules/bigbio/qpx/openmsconsensus/tests/main.nf.test
  • modules/bigbio/qpx/openmsconsensus/tests/nextflow.config

Comment thread modules/bigbio/qpx/openmsconsensus/environment.yml Outdated
…dentation

- environment.yml: replace unpinned 'pip: qpx' with 'bioconda::qpx=1.1.1'
  so -profile conda resolves the same artifact as the biocontainers image
  (built from the bioconda recipe) and satisfies nf-core lint (tool=version).
- openmsconsensus/main.nf: the versions.yml heredoc used space indentation,
  but <<- strips tabs not spaces, so it would emit an indented (malformed)
  top-level YAML key; align to col-0 like the diann subtool.
The detection matched only modules/org/module/ (2 levels) and looked for
modules/org/module/tests/main.nf.test, so subtool modules like
bigbio/qpx/diann and bigbio/qpx/openmsconsensus got zero CI. Walk up from
each changed file to the nearest ancestor with tests/main.nf.test, which
handles both flat and subtool layouts.
…b + snapshot

nf-test has no assume() method (the real test errored with
MissingMethodException). Remove the fixture-guarded real test (which
also needs a hosted consensusXML+SDRF fixture) and keep the stub test,
which passes and now has a committed snapshot. The real openms-consensus
conversion + MuData build are validated out-of-band against the qpx
1.1.1 container; a real nf-test can be added once the fixture is hosted
(mirroring the diann subtool).
qpx is published to ghcr.io/bigbio/qpx on every release (available
immediately on tag), whereas the bioconda->biocontainers->Galaxy-depot
chain lags by hours-to-days. Point both subtools at a single
ghcr.io/bigbio/qpx:1.1.1 image (serves Docker natively and Singularity
via docker://), matching quantms. -profile conda still resolves
bioconda::qpx from environment.yml. Unblocks the module + downstream
pipelines on release without waiting for biocontainers.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 108-110: Replace the `${TEST_FILES[@]}` regex membership check
with an explicit loop over `"${TEST_FILES[@]}"` that compares each existing
element to `test_file`, appending only when no match is found. Update the
deduplication logic in the surrounding test-file collection block while
preserving insertion order and validating distinct entries correctly.

In `@modules/bigbio/qpx/openmsconsensus/tests/main.nf.test`:
- Around line 13-18: Add a fixture-based execution test in the OpenMS consensus
test suite, replacing the TODO stub. Provide small consensusXML and SDRF
fixtures, run the real conversion and MuData build process, and assert the
resulting qpx_dataset, mudata, and versions outputs before release.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 366b9c03-8b6f-4a2d-b258-18d7046fc204

📥 Commits

Reviewing files that changed from the base of the PR and between 95646ca and 1e37b91.

⛔ Files ignored due to path filters (1)
  • modules/bigbio/qpx/openmsconsensus/tests/main.nf.test.snap is excluded by !**/*.snap
📒 Files selected for processing (6)
  • .github/workflows/ci.yml
  • modules/bigbio/qpx/diann/environment.yml
  • modules/bigbio/qpx/diann/main.nf
  • modules/bigbio/qpx/openmsconsensus/environment.yml
  • modules/bigbio/qpx/openmsconsensus/main.nf
  • modules/bigbio/qpx/openmsconsensus/tests/main.nf.test
🚧 Files skipped from review as they are similar to previous changes (3)
  • modules/bigbio/qpx/openmsconsensus/main.nf
  • modules/bigbio/qpx/diann/main.nf
  • modules/bigbio/qpx/diann/environment.yml

Comment thread .github/workflows/ci.yml
Comment on lines +108 to +110
if [[ ! " ${TEST_FILES[@]} " =~ " ${test_file} " ]]; then
TEST_FILES+=("$test_file")
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Use explicit element comparison for deduplication.

At Line 108, ${TEST_FILES[@]} expands one word per array element inside [[ ... =~ ... ]]. When TEST_FILES already contains multiple entries, the condition does not reliably evaluate one complete membership string. Processing a third unique module can fail or produce an invalid conditional expression.

Use an explicit loop over "${TEST_FILES[@]}".

Proposed fix
-                          if [[ ! " ${TEST_FILES[@]} " =~ " ${test_file} " ]]; then
+                          already_seen=false
+                          for existing_test_file in "${TEST_FILES[@]}"; do
+                              if [[ "$existing_test_file" == "$test_file" ]]; then
+                                  already_seen=true
+                                  break
+                              fi
+                          done
+                          if [[ "$already_seen" == false ]]; then
                               TEST_FILES+=("$test_file")
+                          fi

Verify the current expression with three distinct test files:

#!/usr/bin/env bash
set -euo pipefail

TEST_FILES=()

for test_file in \
  modules/bigbio/qpx/diann/tests/main.nf.test \
  modules/bigbio/qpx/openmsconsensus/tests/main.nf.test \
  modules/bigbio/onsite/tests/main.nf.test
do
  if [[ ! " ${TEST_FILES[@]} " =~ " ${test_file} " ]]; then
    TEST_FILES+=("$test_file")
  fi
done

test "${`#TEST_FILES`[@]}" -eq 3
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 108 - 110, Replace the
`${TEST_FILES[@]}` regex membership check with an explicit loop over
`"${TEST_FILES[@]}"` that compares each existing element to `test_file`,
appending only when no match is found. Update the deduplication logic in the
surrounding test-file collection block while preserving insertion order and
validating distinct entries correctly.

Comment on lines +13 to +18
// TODO real-data test: mirror the diann subtool's test once a small OpenMS
// consensusXML + SDRF fixture (`<ACC>.zip` with `openms.consensusXML` +
// `sample.sdrf.tsv`) is hosted under the PRIDE pmultiqc example-projects, then
// add a test that downloads it and asserts qpx_dataset/mudata/versions. The
// openms-consensus conversion + MuData build have been validated out-of-band
// against the qpx 1.1.1 container on a real 2-replicate consensusXML.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Add a fixture-based execution test before release.

The stub test does not execute the conversion command or the MuData build. Add a small consensusXML and SDRF fixture that runs the real process and validates qpx_dataset, mudata, and versions.

I can generate the fixture test when the hosted test data is available.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@modules/bigbio/qpx/openmsconsensus/tests/main.nf.test` around lines 13 - 18,
Add a fixture-based execution test in the OpenMS consensus test suite, replacing
the TODO stub. Provide small consensusXML and SDRF fixtures, run the real
conversion and MuData build process, and assert the resulting qpx_dataset,
mudata, and versions outputs before release.

qpx 1.1.1 renamed --duckdb-threads/--duckdb-max-memory to
--max-cpus/--max-memory. Bumping the diann subtool to 1.1.1 exposed the
old flags ('No such option --duckdb-threads'); update the command.
@ypriverol
ypriverol requested a lite review from Copilot August 6, 2026 10:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ypriverol
ypriverol requested a review from daichengxin August 6, 2026 10:38
CodeRabbit flagged the env pinning a version not yet available. qpx
1.1.1 is on PyPI now but bioconda hasn't autobumped it, so
bioconda::qpx=1.1.1 doesn't resolve. Pin the PyPI release via pip to
match the GHCR container (1.1.1) and keep -profile conda working;
pinning 1.0.2 (the latest bioconda) would drop openms-consensus
entirely. Revert to bioconda::qpx=1.1.1 once bioconda publishes it.
@ypriverol

Copy link
Copy Markdown
Member Author

Thanks @coderabbitai — addressed both:

1. environment.yml version alignment (Major). Fixed in the latest commit. Context: the release moved since the review — qpx v1.1.1 is tagged and on PyPI now (GHCR built from the tag), but bioconda still lags (only 1.0.2/1.1.0), so bioconda::qpx=1.1.1 didn't resolve. Pinning 1.0.2 (the suggested existing release) isn't viable — 1.0.2 predates the openms-consensus subcommand this module runs, so the container (1.1.1) and conda would diverge in behavior, not just version. Resolution: pin the conda env to the PyPI release qpx==1.1.1 (exists now, matches the GHCR container). We'll switch back to bioconda::qpx=1.1.1 once bioconda autobumps it.

2. Executable conversion test / fixture (Nitpick). The invalid assume(...) skip was removed (nf-test has no such method); the stub test passes with a committed snapshot. A real-data test needs a small hosted consensusXML+SDRF fixture (like the diann subtool's PRIDE archive) — tracked as a follow-up. In the meantime the openms-consensus conversion + MuData build are validated end-to-end against the 1.1.1 container out-of-band (real 2-replicate consensusXML → full dataset + 2 obs × 290 vars MuData), and the diann subtool exercises the same qpxc + build_mudata path in CI.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@​ypriverol Thanks for the detailed clarification.

qpx==1.1.1 from PyPI aligns the Conda environment with ghcr.io/bigbio/qpx:1.1.1. Using Bioconda 1.0.2 would not support openms-consensus, so it is not a valid fallback.

The removal of assume(...) resolves the nf-test issue. The committed stub snapshot provides current CI coverage. The real-data fixture is appropriate follow-up work.

🐇 ✅


✏️ Learnings added
Learnt from: ypriverol
URL: https://github.com/bigbio/nf-modules/pull/45

Timestamp: 2026-08-06T10:44:03.319Z
Learning: For the `modules/bigbio/qpx/openmsconsensus` Nextflow module, use the PyPI dependency `qpx==1.1.1` while Bioconda does not provide QPX 1.1.1. Do not use Bioconda QPX 1.0.2 as a fallback because it predates the required `openms-consensus` subcommand. Switch the Conda dependency back to `bioconda::qpx=1.1.1` after Bioconda publishes that version.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

You are interacting with an AI system.

@ypriverol
ypriverol merged commit a0742a8 into main Aug 6, 2026
8 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Aug 8, 2026
11 tasks
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.

2 participants