Repository navigation
Read large Olink CSV exports faster - #46
Merged
Merged
Conversation
PAD000061's 1.7 GB Explore HT CSV took 284 s to read; now about 43 s, with identical expression, sample, feature, LOD and QC-flag tables. - the delimiter is taken from the header line and the file is parsed with pandas' C engine instead of sniffing with the Python engine; files the C engine cannot parse fall back to the Python engine - QC flags are normalised once per distinct value and placed into the sample x assay matrix by position instead of pivot_table; the first non-missing measurement still wins Peak memory on that file rises from 3.7 to 4.7 GB (whole-column parsing). Checked identical against the previous reader on all 15 local Olink files.
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (2)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
PAD000061 (1.7 GB Explore HT CSV, 6.1M rows): read in ~6.7 s with a 2.5 GB peak, against 294 s and 4.2 GB for the previous reader. - parse with pyarrow, reading only the columns the reader uses (14 of 30 here) and storing identifiers and flags as categories; files of 256 MB or more are streamed in blocks to bound peak memory; files pyarrow cannot parse fall back to pandas - NPX and LOD matrices are built by position instead of pivot_table, with the same semantics (first non-missing value, assays sorted, assays without values dropped); QC flags keep integer codes until the final table - sample IDs are always text: numeric-looking IDs keep leading zeros - NPX is parsed exactly: pandas' default fast float parser was off in the last binary digit for 87,407 of 5.9M NPX values in that file (|diff| <= 9e-16); pyarrow matches Python float() for all of them Identical output to the previous reader on all 15 local Olink files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes the Olink CSV reader faster and lighter. It's the last commit of #45 (merged before it was pushed), now reworked.
Result on PAD000061 (1.7 GB Explore HT CSV, 6.1 M rows, 1,118 samples × 5,425 assays)
mainPeak is the process peak over three runs (2.5–2.7 GB). The previous version of this PR took 43 s and 4.7 GB.
How
pivot_table, with the same behaviour: first non-missing value per cell, assays sorted, assays with no values dropped. QC flags stay as integer codes until the final table.Output
main's reader on all 15 local Olink files (CSV and parquet): expression, samples, features, LOD and QC-flag tables.mainexactly. NPX and LOD differ in the last binary digit (|diff| ≤ 9×10⁻¹⁶ NPX, 2×10⁻¹⁵ LOD). pandas' default fast float parser misrounds 87,407 of the 5.9 M NPX values, while pyarrow matches Python's correctly roundedfloat()for all of them. The new values are the exact ones.0670628553stayed670628553before).Tests
MissingFreqvalues like30%;Summary by CodeRabbit