Repository navigation
Conversation
timtreis
force-pushed
the
audit/merscope-reader
branch
from
October 15, 2026 22:11
e4a8ddf to
7e5c789
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #428 +/- ##
==========================================
+ Coverage 65.79% 68.03% +2.23%
==========================================
Files 26 26
Lines 3263 3272 +9
==========================================
+ Hits 2147 2226 +79
+ Misses 1116 1046 -70
🚀 New features to boost your workflow:
|
- transcripts: make `gene` a known categorical before PointsModel.parse so categories are not inferred from the first dask partition (which can drop genes absent from partition 0); pass sort=True and drop the redundant post-parse re-cast - table: store X as csr_matrix like the other scverse readers (MERSCOPE matrices are ~10% dense; ~1GB -> ~200MB on a 960-gene panel) - read the micron-to-pixel transform only when present, else fall back to an identity transform with a warning, so table/transcripts-only reads work - handle a missing images/ directory in merscope() with a warning - sort channel names for a deterministic image channel order - accept string paths in vpt_outputs dict mode (wrap in Path) - normalise boundary geometries to MultiPolygon so plain Polygons don't crash Add merscope reader-fix tests to tests/test_merscope.py.
timtreis
force-pushed
the
audit/merscope-reader
branch
from
October 16, 2026 06:01
7e5c789 to
6a2e15f
Compare
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.
Audited
merscope()against real Vizgen data (Figshare VPT output: 137k cells / 70.5M transcripts / 960-gene panel; the Vizgen showcase mosaic images; GSE241870 for the counted-cell-without-polygon case). Each fix has a regression test (fails onmain, passes here).genewas passed toPointsModel.parseas object dtype, leaving dask categories "unknown"; spatialdata then infers them from the first partition only, turning genes absent from partition 0 intoNaN. Now a known categorical before parse;sort=Truedrops a redundant eager index scan.int64. Nowcsr_matrixlike the other scverse readers (~1,057 MB → ~197 MB on the Figshare panel); also removes the deprecatedAnnData(dtype=...)arg.images/. The micron→pixel transform was read unconditionally; table/transcripts-only reads now fall back to an identity transform with a warning.list(set(...)),PYTHONHASHSEED-dependent) →sorted().'str' object has no attribute 'exists') → values wrapped inPath.Polygonboundaries crashedMultiPolygon(x.geoms)→ geometries normalised to MultiPolygon.No public API changes. Adds
tests/test_merscope.py(self-contained synthetic fixtures). ruff / ruff-format / mypy clean.