Repository navigation
fix(protein-properties): rewrite views in decoded-size-bounded batches - #338
Conversation
The --fasta protein-properties rewrite read each pg/feature row group in one call. On a 1,113-file TMT dataset (PXD023662) the pg view's dictionary-encoded grouped_runs column (~1,113 run names per row) decodes to 7.8 GB in a single row group whose footer reports 173 MB, so pyarrow raised "Nested data conversions not implemented for chunked array outputs" and the conversion failed. Stream each row group with iter_batches, sizing batches from the decoded bytes of a small probe batch (the footer's encoded size understates nested dictionary columns ~50x), capped at 256 MB per batch. Output is unchanged. Validated on the real PXD023662 pg view in the qpx 1.1.4 container: unpatched fails (10.9 GB RSS); patched completes in 49 s at 1.9 GB, and the full openms-consensus convert + MuData step completes (peak ~62 GB) with 100% of target groups annotated.
|
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 configuration
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 |
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
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.
qpx 1.1.5 carries the protein-properties batched rewrite (bigbio/qpx#338, pyarrow 2 GB crash on large TMT) and the 1.1.4..1.1.5 converter fixes. qpx 1.1.5 `convert diann` / `convert openms-consensus` now write the MuData view themselves (--mudata, default on) through the same write_dataset_mudata guard the modules called. Drop the modules' own python build, which would rebuild the h5mu a second time, and just move the CLI-written view out of qpx_output.
Problem
convert openms-consensus --fasta(andtransform protein-properties) failed on a large TMT dataset, PXD023662 with 1,113 raw files:The cause is the pg view's
grouped_runs(list<string>). It is dictionary-encoded and repeats about 1,113 run names on every row. Row group 0 decodes to 7.8 GB, while the footer reports only 173 MB. Reading a whole row group at once overflows pyarrow's single-array limit.Fix
_rewrite_viewnow streams each row group withiter_batches. It sizes each batch by decoding a 64-row probe and measuring its in-memory bytes per row, then caps batches at 256 MB decoded. Sizing from the footer's encodedtotal_byte_sizeis not enough: it understates nested dictionary columns by about 50×, and an earlier version of this fix that used it still failed on the real data. The output is unchanged.Validation
Unit tests. Two new regression tests:
read_row_groupraising this error and tiny batches gives the same result as a normal run.The full suite passes: 1,609 tests.
Real data (PXD023662 pg view, qpx 1.1.4 container, patched module bind-mounted):
The full
convert openms-consensusplus the MuData step also completes, at about 62 GB peak. Row counts are unchanged: pg 1,221,160 and feature 7,326,284. Of the target groups, 100% getsequence_coverageandmolecular_weight.Not in this PR
qpxc validateon the same pg view fails separately, with DuckDB's "Arrow Appender: maximum total string size 2147483647". That happens on the unpatched output too. It will be filed as its own issue.