Repository navigation
feat(qpx): 1.1.4, MuData modality guard, and optional search FASTA - #52
Conversation
Both QPX modules called build_mudata() + mdata.write() directly, which
bypasses qpx's own writer. write_dataset_mudata checks
missing = required_modalities - set(mdata.mod)
and refuses a MuData that lacks a required quantification modality;
build_mudata catches per-modality failures, logs them and continues, so a
modality that failed to build was simply absent. The module then wrote that
INCOMPLETE h5mu and the task exited 0. On MSV000085836 that shipped a view
with proteins and no precursors, from a pyarrow offset overflow
(bigbio/qpx#316, fixed in 1.1.4: that dataset now yields
['precursors', 'proteins'], 5520 x 633097).
*.h5mu becomes an optional output again. As a required output it inverted
qpx's contract — the parquet views are the dataset's source of truth and
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.
Container and conda pins move to 1.1.4, which also brings the modality
reporting (#318), the DIA-NN contaminant/quantification_method fields and
the OpenMS protein annotations. Stub tests pass unchanged for both modules.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughBoth QPX modules update to version 1.1.4. Their MuData outputs are optional. MuData writing now uses ChangesQPX MuData output update
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant QPX_Process
participant write_dataset_mudata
participant parquet_views
QPX_Process->>write_dataset_mudata: Build MuData from qpx_output
write_dataset_mudata->>parquet_views: Validate required quantification modality
write_dataset_mudata-->>QPX_Process: Return generated file or None
QPX_Process->>parquet_views: Warn when no h5mu is produced
QPX_Process->>QPX_Process: Move successful output to prefix.h5mu
Merge Risk: ⚪ Minimal · up to The change has no identified actionable merge risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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 QodoGuard optional MuData generation and upgrade QPX to 1.1.4
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Up to standards ✅🟢 Issues
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can group findings by type and pick your Finding display, from Minimal to Full |
editorconfig-checker: the wrapped print( continuation sat at 10 spaces; the repo requires left-padding in multiples of 4.
qpx 1.1.4 accepts --fasta on both converters and fills, for target rows only and only where null, pg.sequence_coverage, pg.molecular_weight and feature.pg_positions. DIA-NN never reports protein sequences, and some consensusXML files carry protein hits without them (MSV000085836 has 14,071 hits with no sequence), so without a FASTA those fields stay empty. Both pipelines already have the search database, so both modules take it as an optional last input: pass the FASTA, or [] when unavailable. The input is appended, so existing positional inputs are unchanged. A producer value is never overwritten, and proteins absent from the FASTA (DIA-NN's internal decoys, contaminants from another database) stay null and are counted in the step's report. Measured with 1.1.4 on the real datasets: PXD017199 (DIA) and MSV000085836 (TMT) go from 0% to 100% coverage and molecular weight, and PXD017199 from 0% to 100% positions; on PXD000612, where OpenMS records these itself, the FASTA values reproduce them (molecular weight identical on all 290,229 rows, coverage median difference 0.0 points).
Both
qpx/diannandqpx/openmsconsensusare updated; quantms vendors the first, quantmsdiann the second, and both had the same defects.1. A partial MuData could ship as success
The modules called
build_mudata()+mdata.write()directly, bypassing qpx's own writer.write_dataset_mudatachecksmissing = required_modalities - set(mdata.mod)and refuses a MuData missing a required quantification modality;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 (TMT, 552 runs x 10 channels) that shipped an h5mu with
proteinsand noprecursors, from a pyarrow int32 offset overflow (bigbio/qpx#316). 1.1.4 fixes the overflow — that dataset now yields['precursors', 'proteins'](5,520 x 633,097) — but the guard matters for any future modality failure.2.
*.h5muis optional againAs a required output it inverted qpx's contract: the parquet views are the dataset's source of truth and the MuData view is best-effort. It turned a best-effort artifact into a run-killer — MSV000085836 lost a ~1h19 conversion to it three times.
3. Optional search FASTA
qpx 1.1.4 accepts
--fastaon both converters and fills, for target rows only and only where null,pg.sequence_coverage,pg.molecular_weightandfeature.pg_positions. DIA-NN never reports protein sequences, and some consensusXML files carry protein hits without them (MSV000085836: 14,071 hits, none with a sequence), so without a FASTA those fields stay empty.Both pipelines already have the search database, so each module takes it as an optional last input: pass the FASTA, or
[]when unavailable. Appending it leaves existing positional inputs unchanged. A producer value is never overwritten, and proteins absent from the FASTA (DIA-NN's internal decoys, contaminants from another database) stay null and are counted in the step's report.Measured with 1.1.4 on real data:
pg.sequence_coverage/molecular_weightfeature.pg_positionsOn PXD000612, where OpenMS records these itself, the FASTA values reproduce them: molecular weight identical on all 290,229 rows, coverage median difference 0.0 points (correlation 0.9995).
Pins
Container and conda move to 1.1.4 (on GHCR and PyPI; the image is stamped
1.1.4, unlike the floating:devtag which reports0.0.0.dev0and would land in dataset provenance andversions.yml). 1.1.4 also brings failed-modality reporting, DIA-NNpg.contaminant/quantification_method, OpenMS protein annotations and positions, and integrity-verification fixes.Tests
Stub tests pass for both modules with no snapshot drift; CI's docker module tests pass for both.
Downstream
quantms and quantmsdiann need
nf-core modules updateonce this merges, and their workflows should pass the search database to the new input. bigbio/quantms#732 (currently a draft that hand-edits the vendored copy) will be redone that way.