Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #421 +/- ##
==========================================
+ Coverage 63.53% 63.70% +0.17%
==========================================
Files 26 26
Lines 3263 3265 +2
==========================================
+ Hits 2073 2080 +7
+ Misses 1190 1185 -5
🚀 New features to boost your workflow:
|
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.
Respect filtered_counts_file when loading Visium HD cell matrices
This PR addresses #390 by making Visium HD cell-matrix loading respect
filtered_counts_file.Passing
filtered_counts_file=Falsecurrently switches the binned matrix to raw counts, but segmented cells still come fromfiltered_feature_cell_matrix.h5. This changes the cell-matrix path to follow the same flag, including the check for whether the file exists. The default remains filtered.The change adds the raw-cell filename to
VisiumHDKeysand updates the reader docstring and CLI help. Nucleus counts still come from the filtered 2 µm matrix. The existing barcode-to-polygon matching is unchanged: rows without matching polygons are not included in the cell table.Testing
I checked the original and patched readers against the public 10x Visium HD 3' Tiny Mouse Brain dataset, generated with Space Ranger 4.0.1.
True)False)The raw flag previously returned the filtered cell set. After the patch, barcode order and every count match the requested source matrix, while default and explicit filtered reads remain unchanged.
The additional 339 cells have zero counts, so total UMIs stay at 10,823. This checks that raw cell rows are retained; it does not show additional expression being recovered. Gene IDs, polygon coordinates, table-to-shape links and hires/lowres transforms also matched, and source-file checksums were unchanged. This is a downsampled developer dataset, not a biological accuracy test. Both versions emitted the same duplicate-gene-name and missing-full-resolution-image warnings.
The filename and barcode conventions are described in the 10x segmented-output specification. This is a file-selection fix, not a change to segmentation or count aggregation.
I kept the new regression tests in a separate file because #401 is reorganizing the test suite. The file may need moving to fit that layout before merge.
Reproduce the real-data comparison
Run from the repository root with its development environment active. The archive is about 297 MiB and is licensed CC BY 4.0 by 10x Genomics. These commands use a new temporary directory and leave the repository's test data unchanged.
Then compare the reader against the source matrices:
The patched reader passes all three selections: 612, 612 and 951 cells, each with 10,823 UMIs. On the original code, the raw-selection barcode assertion fails. All source barcodes have matching polygons in this particular sample; that is not guaranteed for every dataset.
These commands reproduce the cell/count comparison. The separate local validation also checked polygon coordinates, transforms and unchanged input checksums. No visual overlay review, real-data Zarr round-trip or multi-version validation was performed.