Repository navigation
fix(qpx): use write_dataset_mudata so a partial MuData cannot ship #732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,4 +7,4 @@ dependencies: | |
| # publishes it. | ||
| - pip | ||
| - pip: | ||
| - qpx==1.1.3 | ||
| - qpx==1.1.4 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ 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) | ||
|
|
@@ -17,7 +17,9 @@ process QPX_OPENMSCONSENSUS { | |
|
|
||
| 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 | ||
|
Comment on lines
+20
to
+22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3. Users expect a sometimes-absent output The mudata declaration now makes the .h5mu view optional, while docs/output.md still presents the combined MuData container as an unconditional part of the published QPX artifact. Whenever write_dataset_mudata returns None, the documented output is absent without documentation explaining the failure condition or that the parquet views remain authoritative. Agent Prompt
|
||
| path "versions.yml", emit: versions | ||
|
|
||
| when: | ||
|
|
@@ -39,14 +41,24 @@ process QPX_OPENMSCONSENSUS { | |
| ${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.") | ||
|
Comment on lines
+55
to
+58
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Broken view safeguards go undetected The normal script introduces write_dataset_mudata and its None branch, but the sole nf-test runs with -stub and never executes either path. The stub always creates an .h5mu file and asserts one output, so it cannot detect regressions in partial-view rejection or the optional no-view behavior. Agent Prompt
|
||
| else: | ||
| shutil.move(str(written), "${prefix}.h5mu") | ||
| print(f"MuData -> ${prefix}.h5mu") | ||
| PY | ||
|
|
||
| cat <<-END_VERSIONS > versions.yml | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Module tests cannot pull the image
📘 Rule violation☼ ReliabilityAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools