Repository navigation
feat(convert): write the MuData view from diann and openms-consensus - #332
Conversation
Both converters wrote the Parquet views and stopped, so every caller had to build the MuData view itself. The nf-modules qpx modules did that with an embedded Python heredoc, and the first version of it called build_mudata() + mdata.write() directly — which skips a modality that fails to build and writes an incomplete h5mu with exit 0 (#316, MSV000085836 shipped proteins with no precursors). --mudata/--no-mudata (default on) now writes it through write_dataset_mudata, the same guarded writer convert openms already used: it refuses a MuData missing a required quantification modality, writes via a temporary file and drops a stale view. It stays best-effort — the Parquet views are the dataset's source of truth — so a view that cannot be built is reported and the conversion still succeeds. --no-mudata skips the build on very large datasets. The modules can drop their embedded Python once they pin a release with this; they keep it for now, since they pin 1.1.4. Five tests, all failing on dev.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
PR Summary by QodoWrite MuData views from DIA-NN and OpenMS consensus conversions
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 5 |
| Duplication | 2 |
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.
Code Review by Qodo
1. Reruns mix prior quantification data
|
Follow-up to the nf-modules review (bigbio/nf-modules#52): the modules carry an embedded Python heredoc to build the MuData view, because these two converters never wrote it.
convert openms(the deprecated-out_qpxpath) already does, via the orchestrator.Why it matters
The first version of that heredoc called
build_mudata()+mdata.write()directly, which bypasses the guard inwrite_dataset_mudata:build_mudatacatches 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 an h5mu withproteinsand noprecursors(#316). Logic like that does not belong in a Nextflow heredoc where it cannot be tested.Changes
--mudata/--no-mudata(default on) onconvert diannandconvert openms-consensus, writing throughwrite_dataset_mudata: refuses a MuData missing a required quantification modality, writes via a temporary file, drops a stale view.--no-mudataskips the build for very large datasets.--fastastep, so the view reflects the final Parquet.Tests
Five new tests, each failing on
dev: default writes the view and--no-mudataskips it (both converters), plus the best-effort failure path. Full suite 1,263 passed; pre-commit clean; pylint reports the same 3 pre-existing issues asdev.Downstream
The nf-modules qpx modules keep their heredoc for now, since they pin 1.1.4. Once they pin a release containing this, both modules reduce to the
qpxc convert …call, and theshutil.movedisappears with it (the writer puts the view in the dataset folder, next to the Parquet, matching the published S3 layout).