Skip to content

chore(qpx): update the openmsconsensus module and pass the search database - #733

Merged
ypriverol merged 1 commit into
bigbio:devfrom
ypriverol:chore/qpx-114-module-update
Sep 16, 2026
Merged

ypriverol merged 1 commit into
bigbio:devfrom
ypriverol:chore/qpx-114-module-update

Conversation

@ypriverol

Copy link
Copy Markdown
Contributor

Proper module update for bigbio/nf-modules#52 (nf-core modules update bigbio/qpx/openmsconsensus -> d9e1b05). Supersedes #732, which hand-edited the vendored copy and would have been overwritten by the next update.

What the module update brings

  • write_dataset_mudata instead of build_mudata + mdata.write(). build_mudata catches per-modality failures, logs them and continues, so a failed modality is simply absent — the module wrote that incomplete h5mu and the task exited 0. On MSV000085836 that shipped a view with proteins and no precursors (fix(mudata): widen strings before combining chunks qpx#316; 1.1.4 fixes the underlying pyarrow overflow, and that dataset now yields ['precursors','proteins'], 5,520 x 633,097).
  • *.h5mu is optional again. As a required output it inverted qpx's contract — the parquet views are the source of truth, the MuData view is best-effort — and turned a best-effort artifact into a run-killer: MSV000085836 lost a ~1h19 conversion to it three times.
  • qpx 1.1.4 container and conda pins.
  • An optional FASTA input.

Passing the search database

LFQ and TMT now pass ch_database_wdecoy, the database the search actually used, so qpx fills null pg.sequence_coverage, pg.molecular_weight and feature.pg_positions for target rows (producer values are never overwritten; proteins absent from the FASTA stay null and are counted).

Two details:

  • The with-decoy database is safe. qpx skips FASTA decoy entries, which also prevents DECOY_sp|P12345|… from colliding with the target accession.
  • .first() keeps it a value channel; the same channel already feeds ID and PROTEOMICSLFQ.

Measured with 1.1.4: TMT MSV000085836 goes from 0% to 100% coverage and molecular weight. On PXD000612, where OpenMS records these itself, FASTA values reproduce them (molecular weight identical on all 290,229 rows, coverage median difference 0.0 points).

Checks

nextflow lint: 20 files, no errors. The vendored module's stub test passes (NXF_VER=25.10.4 nf-test).

quantmsdiann gets the same treatment for qpx/diann in a separate PR.

…abase

nf-core modules update bigbio/qpx/openmsconsensus -> bigbio/nf-modules d9e1b05,
which brings:

- write_dataset_mudata instead of build_mudata + mdata.write(), so a MuData
  missing a required quantification modality is refused rather than written.
  The old path shipped an h5mu with proteins and no precursors on
  MSV000085836 and exited 0 (bigbio/qpx#316).
- *.h5mu optional again: the parquet views are the dataset's source of
  truth, so a best-effort artifact no longer kills an otherwise complete
  run. MSV000085836 lost a ~1h19 conversion to it three times.
- container/conda pinned to qpx 1.1.4.
- an optional FASTA input.

LFQ and TMT now pass ch_database_wdecoy — the database the search actually
used — so qpx fills null pg.sequence_coverage, pg.molecular_weight and
feature.pg_positions for target rows. Decoy entries are skipped by the
reader, so the with-decoy database is safe to pass, and .first() keeps it a
value channel because the same channel already feeds ID and PROTEOMICSLFQ.

Supersedes bigbio#732, which hand-edited the vendored module.
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: c500c7f0-592c-478e-bf9e-07fddaf40858

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Update OpenMS consensus QPX module and pass search FASTA

🐞 Bug fix ✨ Enhancement ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Updates OpenMS consensus conversion to QPX 1.1.4 and the upstream module revision.
• Enriches LFQ and TMT outputs from search FASTA without overwriting producer values.
• Makes validated MuData generation best-effort while preserving authoritative Parquet outputs.
Diagram

graph TD
  FASTA["Search FASTA"] -->|search database| ID["Protein ID"] -->|identifications| QUANT["LFQ / TMT"] -->|consensusXML| QPX["QPX converter"] -->|authoritative| PARQUET["Parquet dataset"]
  FASTA -->|metadata enrichment| QPX
  QPX -.->|best effort| MUDATA["MuData view"]
Loading
High-Level Assessment

The upstream module update is the preferred approach because it preserves nf-core module provenance and avoids maintainability problems from hand-editing vendored code. Passing the actual search FASTA directly to QPX centralizes enrichment and decoy handling, while the QPX writer provides stronger validation than custom MuData checks in the pipeline.

Files changed (7) +56 / -16

Enhancement (2) +10 / -0
lfq.nfPass the LFQ search database into QPX +5/-0

Pass the LFQ search database into QPX

• Passes the with-decoy FASTA used by identification and ProteomicsLFQ to the QPX converter. Calling first() preserves value-channel behavior when the channel is reused by multiple consumers.

workflows/lfq.nf

tmt.nfPass the TMT search database into QPX +5/-0

Pass the TMT search database into QPX

• Passes the with-decoy identification FASTA to QPX so missing target protein coverage, molecular weight, and feature positions can be populated. The channel is converted to a reusable value channel with first().

workflows/tmt.nf

Bug fix (1) +30 / -9
main.nfValidate MuData output and accept an optional search FASTA +30/-9

Validate MuData output and accept an optional search FASTA

• Updates the container to QPX 1.1.4 and forwards an optional FASTA to the converter for missing protein metadata enrichment. Replaces direct MuData construction with QPX's validated writer and makes h5mu output optional so failed best-effort views do not invalidate complete Parquet results.

modules/bigbio/qpx/openmsconsensus/main.nf

Tests (1) +1 / -0
main.nf.testAdapt the stub test to the FASTA input +1/-0

Adapt the stub test to the FASTA input

• Supplies an empty optional FASTA value to the module stub test while retaining existing output and snapshot assertions.

modules/bigbio/qpx/openmsconsensus/tests/main.nf.test

Documentation (1) +8 / -0
meta.ymlDocument the optional FASTA module input +8/-0

Document the optional FASTA module input

• Adds the FASTA input contract, supported filename patterns, and enrichment behavior to the module metadata.

modules/bigbio/qpx/openmsconsensus/meta.yml

Other (2) +7 / -7
modules.jsonTrack the updated OpenMS consensus module revision +6/-6

Track the updated OpenMS consensus module revision

• Updates the vendored qpx/openmsconsensus module SHA to bigbio/nf-modules revision d9e1b05. The pmultiqc entry is reordered without changing its revision.

modules.json

environment.ymlPin the Conda environment to QPX 1.1.4 +1/-1

Pin the Conda environment to QPX 1.1.4

• Raises the pip-installed QPX version from 1.1.3 to 1.1.4 for the module's Conda execution path.

modules/bigbio/qpx/openmsconsensus/environment.yml

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Successful runs omit a promised file 🐞 Bug ⚙ Maintainability
Description
QPX_OPENMSCONSENSUS now declares mudata optional and explicitly succeeds when
write_dataset_mudata returns None, but the module metadata and output guide still describe the
container as an unconditional output. Any best-effort MuData build failure therefore produces a
successful run whose published qpx/ contents violate the documented module and user-facing
contracts.
Code

modules/bigbio/qpx/openmsconsensus/main.nf[27]

+    path "*.h5mu"      , emit: mudata, optional: true
Evidence
The changed output declaration permits no .h5mu, and the new None branch deliberately completes
without creating one. The metadata and output guide nevertheless list the container without any
conditional or optional qualification.

modules/bigbio/qpx/openmsconsensus/main.nf[25-27]
modules/bigbio/qpx/openmsconsensus/main.nf[62-67]
modules/bigbio/qpx/openmsconsensus/meta.yml[52-56]
docs/output.md[164-165]
docs/output.md[242-249]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The MuData output is now optional, while the module metadata and user-facing output documentation still promise it as part of every QPX result.

## Fix Focus Areas
- modules/bigbio/qpx/openmsconsensus/main.nf[25-27]
- modules/bigbio/qpx/openmsconsensus/meta.yml[52-56]
- docs/output.md[164-165]
- docs/output.md[242-249]

## Recommended Fix
Describe the MuData container as a best-effort optional output in the module output metadata and both user-facing QPX output descriptions, while retaining the Parquet views as the guaranteed artifact.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: ⚖️ Balanced: This changes a workflow module interface and runtime behavior, including optional FASTA channel wiring, database propagation, and MuData failure handling across multiple paths, so it warrants a careful single-pass review.

Grey Divider

Tip of the day
💡 Did you know, you can group findings by type and pick your Finding display, from Minimal to Full

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

path "*.h5mu" , emit: mudata
// Optional: the parquet views are the dataset's source of truth, so a MuData
// view that cannot be built must not destroy an otherwise complete run.
path "*.h5mu" , emit: mudata, optional: true

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.

Remediation recommended

1. Successful runs omit a promised file 🐞 Bug ⚙ Maintainability

QPX_OPENMSCONSENSUS now declares mudata optional and explicitly succeeds when
write_dataset_mudata returns None, but the module metadata and output guide still describe the
container as an unconditional output. Any best-effort MuData build failure therefore produces a
successful run whose published qpx/ contents violate the documented module and user-facing
contracts.
Agent Prompt
## Issue description
The MuData output is now optional, while the module metadata and user-facing output documentation still promise it as part of every QPX result.

## Fix Focus Areas
- modules/bigbio/qpx/openmsconsensus/main.nf[25-27]
- modules/bigbio/qpx/openmsconsensus/meta.yml[52-56]
- docs/output.md[164-165]
- docs/output.md[242-249]

## Recommended Fix
Describe the MuData container as a best-effort optional output in the module output metadata and both user-facing QPX output descriptions, while retaining the Parquet views as the guaranteed artifact.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@github-actions

Copy link
Copy Markdown

nf-core pipelines lint overall result: Passed ✅ ⚠️

Posted for pipeline commit 71fdb0c

+| ✅ 117 tests passed       |+
#| ❔  18 tests were ignored |#
#| ❔   1 tests had warnings |#
!| ❗   7 tests had warnings |!
Details

❗ Test warnings:

❔ Tests ignored:

❔ Tests fixed:

✅ Tests passed:

Run details

  • nf-core/tools version 4.1.0
  • Run at 2026-09-16 06:02:53

@ypriverol
ypriverol merged commit 8ea4770 into bigbio:dev Sep 16, 2026
38 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant