-
Notifications
You must be signed in to change notification settings - Fork 47
Feat: Support for Visium HD cell segmentation in Space Ranger 4.0 #328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feat: Support for Visium HD cell segmentation in Space Ranger 4.0 #328
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #328 +/- ##
==========================================
- Coverage 49.06% 48.24% -0.83%
==========================================
Files 26 26
Lines 2686 2794 +108
==========================================
+ Hits 1318 1348 +30
- Misses 1368 1446 +78
🚀 New features to boost your workflow:
|
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
@LucaMarconato please let me know if my vignette should go someplace else but I thought it would be good to have one. |
|
|
||
| # TODO: Replace with the actual Visium HD test dataset folder name | ||
| # This dataset name is used to locate the test data in the './data/' directory. | ||
| # See https://github.com/scverse/spatialdata-io/blob/main/.github/workflows/prepare_test_data.yaml | ||
| # for instructions on how to download and place the data on disk. | ||
| DATASET_FOLDER = "Visium_HD_Mouse_Brain_Chunk" | ||
| DATASET_ID = "visium_hd_tiny" | ||
|
|
||
|
|
||
| @skip_if_below_python_version() | ||
| def test_visium_hd_data_extent() -> None: | ||
| """Check the spatial extent of the loaded Visium HD data.""" | ||
| f = Path("./data") / DATASET_FOLDER | ||
| if not f.is_dir(): | ||
| pytest.skip(f"Test data not found at '{f}'. Skipping extent test.") | ||
|
|
||
| sdata = visium_hd(f, dataset_id=DATASET_ID) | ||
| extent = get_extent(sdata, exact=False) | ||
| extent = {ax: (math.floor(extent[ax][0]), math.ceil(extent[ax][1])) for ax in extent} | ||
|
|
||
| # TODO: Replace with the actual expected extent of your test data | ||
| expected_extent = "{'x': (1000, 7000), 'y': (2000, 8000)}" | ||
| assert str(extent) == expected_extent | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to update these once tiny test is added
|
Thanks @stephenwilliams22! We can review the vignette here, but before merging please move it to the If you would like we could add the vignette in gallery in the docs. |
Perfect. moved here scverse/spatialdata-notebooks#152 |
This pr adds support for cell segmentation in Visium HD which was added in Space Ranger 4.0.
Features include
visium_hdfunctionload_segmentations_onlywhich disables bin loadingload_nucleus_segmentationswhich loads nucleus segmentations and calculates a nucleus only expression matrixspatial data structure will look something like
To do based on submission guidelines