Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
"git_sha": "1c93e068aeca6704d042b92c26249cdd801da278",
"installed_by": ["modules"]
},
"qpx/openmsconsensus": {
"pmultiqc": {
"branch": "main",
"git_sha": "7cd54b39383fed0257b916e1060608b7ef322023",
"installed_by": ["modules"]
},
"qpx/openmsconsensus": {
"branch": "main",
"git_sha": "d9e1b05a107342fb5086aeb90fc3e68bc6b3f336",
"installed_by": ["modules"]
},
"thermorawfileparser": {
"branch": "main",
"git_sha": "53f2d78652a7040e3d44610286471642b1e1b55b",
"installed_by": ["modules"],
"patch": "modules/bigbio/thermorawfileparser/thermorawfileparser.diff"
},
"pmultiqc": {
"branch": "main",
"git_sha": "7cd54b39383fed0257b916e1060608b7ef322023",
"installed_by": ["modules"]
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/bigbio/qpx/openmsconsensus/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ dependencies:
# publishes it.
- pip
- pip:
- qpx==1.1.3
- qpx==1.1.4
39 changes: 30 additions & 9 deletions modules/bigbio/qpx/openmsconsensus/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,23 @@ process QPX_OPENMSCONSENSUS {
// a single image serves Docker (native) and Singularity (via docker://).
// BioContainers/Galaxy-depot lag the release, so GHCR is used for containers;
// -profile conda still resolves the bioconda package in environment.yml.
container "ghcr.io/bigbio/qpx:1.1.3"
container "ghcr.io/bigbio/qpx:1.1.4"

input:
path(consensusxml)
path(sdrf)
val(project_accession)
// Optional: the FASTA used for the search, or [] when it is not available.
// qpx fills null pg.sequence_coverage / pg.molecular_weight and
// feature.pg_positions from it, for target rows only, never overwriting a
// producer value; proteins absent from it stay null.
path(fasta)

output:
path "qpx_output/*", emit: qpx_dataset
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

path "versions.yml", emit: versions

when:
Expand All @@ -27,26 +34,40 @@ process QPX_OPENMSCONSENSUS {
def args = task.ext.args ?: ''
def prefix = project_accession ?: 'openms'
def acc_arg = project_accession ? "--project-accession ${project_accession}" : ''
def fasta_arg = fasta ? "--fasta ${fasta}" : ''
"""
set -o pipefail
qpxc convert openms-consensus \\
--consensusxml ${consensusxml} \\
--sdrf-file ${sdrf} \\
${acc_arg} \\
${fasta_arg} \\
--output-folder qpx_output \\
--output-prefix ${prefix} \\
--compression zstd \\
${args}

python - <<'PY'
from qpx.dataset import Dataset
from qpx.mudata import build_mudata
import shutil
from pathlib import Path

ds = Dataset("qpx_output")
mdata = build_mudata(ds)
mdata.write("${prefix}.h5mu")
ds.close()
print(f"MuData: {mdata.n_obs} obs x {mdata.n_vars} vars -> ${prefix}.h5mu")
from qpx.mudata import write_dataset_mudata

# Use qpx's own writer rather than build_mudata + mdata.write. It refuses a
# MuData that is missing a required quantification modality, writes via a
# temporary file, and drops a stale view if the build fails. Calling
# build_mudata directly bypassed that check: a modality that failed to build
# was logged and skipped, so an INCOMPLETE h5mu was written and the task
# exited 0 (bigbio/qpx#316 - MSV000085836 shipped proteins with no precursors).
written = write_dataset_mudata(Path("qpx_output"), "${prefix}")
if written is None:
print(
"WARNING: no MuData view was written; see the log above. "
"The qpx_output parquet views are complete and authoritative."
)
else:
shutil.move(str(written), "${prefix}.h5mu")
print(f"MuData -> ${prefix}.h5mu")
PY

cat <<-END_VERSIONS > versions.yml
Expand Down
8 changes: 8 additions & 0 deletions modules/bigbio/qpx/openmsconsensus/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ input:
- project_accession:
type: string
description: PRIDE project accession (e.g. PXD026600) used as output prefix
- fasta:
type: file
description: |
Optional protein FASTA used for the search, or [] when unavailable. Fills
null pg.sequence_coverage, pg.molecular_weight and feature.pg_positions for
target rows; producer values are never overwritten and proteins absent from
the FASTA (e.g. DIA-NN internal decoys) stay null.
pattern: "*.{fasta,fa,fasta.gz,fa.gz}"
output:
qpx_dataset:
- "qpx_output/*":
Expand Down
1 change: 1 addition & 0 deletions modules/bigbio/qpx/openmsconsensus/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ nextflow_process {
input[0] = file("stub.consensusXML", checkIfExists: false)
input[1] = file("stub_sample.sdrf.tsv", checkIfExists: false)
input[2] = "PXD026600"
input[3] = []
"""
}
}
Expand Down
5 changes: 5 additions & 0 deletions workflows/lfq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ workflow LFQ {
PROTEOMICSLFQ.out.out_consensusXML,
file(params.input),
params.accession ?: '',
// The database the search used. qpx fills null pg.sequence_coverage,
// pg.molecular_weight and feature.pg_positions from it; decoy entries are
// skipped, so the with-decoy database is safe to pass. .first() keeps this
// a value channel, since the same channel already feeds ID and PROTEOMICSLFQ.
ch_database_wdecoy.first(),
)
ch_software_versions = ch_software_versions.mix(QPX_OPENMSCONSENSUS.out.versions)

Expand Down
5 changes: 5 additions & 0 deletions workflows/tmt.nf
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ workflow TMT {
ISOBARIC_WORKFLOW.out.out_consensusXML,
file(params.input),
params.accession ?: '',
// The database the search used. qpx fills null pg.sequence_coverage,
// pg.molecular_weight and feature.pg_positions from it; decoy entries are
// skipped, so the with-decoy database is safe to pass. .first() keeps this
// a value channel, since the same channel already feeds ID.
ch_database_wdecoy.first(),
)
ch_software_versions = ch_software_versions.mix(QPX_OPENMSCONSENSUS.out.versions)

Expand Down
Loading