spatialdata-notebooks icon indicating copy to clipboard operation
spatialdata-notebooks copied to clipboard

feat: visium hd cell segmentation example

Open stephenwilliams22 opened this issue 2 months ago • 4 comments

Provides working example of using Visium HD cell segmentations available with Spaceranger 4.0+. Goes from loading data, to simple QC, to clustering and visualization.

stephenwilliams22 avatar Oct 13 '25 15:10 stephenwilliams22

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Lots of comments on usage and issues can be found here. https://github.com/scverse/spatialdata-io/issues/323#issuecomment-3417087282

stephenwilliams22 avatar Oct 17 '25 21:10 stephenwilliams22

Thanks @stephenwilliams22, it looks great to me!

I add/edited the following:

  • I added a thumbnail and included the notebook in the docs (it will appear with the next code release).
  • I added an intro explanation to the notebook, telling what it covers in addition to the other Visium HD notebook.
  • I removed the part where the data is being downloaded in a temporary directory because it makes the notebook too heavy to run in our CI system. I instead moved that code here: https://github.com/giovp/spatialdata-sandbox/tree/main/visium_hd_4.0.1_io, and I point the reader to that location.
    • Still, I added a discussion about the usage of spatialdata_io.visium_hd(), explaining the new parameters.
    • Also, I have realized that it would be nice for the user to have a simple way to download the data with a single code call instead of having to manually run the scripts from spatialdata-sandbox. We could create a simple package, or create a simple script, to download raw datasets from the original public data source, compare checksums, and convert to Zarr. I have a draft of this here: https://github.com/PMBio/spatialdata-workshops/blob/main/download.py. But this goes beyond the scope of the current PR.

Please let me know if you have any comment. I'll merge after merging the PR in spatialdata-io.

LucaMarconato avatar Oct 27 '25 19:10 LucaMarconato

Thanks @stephenwilliams22, it looks great to me!

I add/edited the following:

  • I added a thumbnail and included the notebook in the docs (it will appear with the next code release).

  • I added an intro explanation to the notebook, telling what it covers in addition to the other Visium HD notebook.

  • I removed the part where the data is being downloaded in a temporary directory because it makes the notebook too heavy to run in our CI system. I instead moved that code here: https://github.com/giovp/spatialdata-sandbox/tree/main/visium_hd_4.0.1_io, and I point the reader to that location.

    • Still, I added a discussion about the usage of spatialdata_io.visium_hd(), explaining the new parameters.
    • Also, I have realized that it would be nice for the user to have a simple way to download the data with a single code call instead of having to manually run the scripts from spatialdata-sandbox. We could create a simple package, or create a simple script, to download raw datasets from the original public data source, compare checksums, and convert to Zarr. I have a draft of this here: https://github.com/PMBio/spatialdata-workshops/blob/main/download.py. But this goes beyond the scope of the current PR.

Please let me know if you have any comment. I'll merge after merging the PR in spatialdata-io.

@LucaMarconato this all sounds great. Thanks a ton for keeping this moving and I look forward to seeing the spatialdata-io PR merged!

stephenwilliams22 avatar Oct 27 '25 20:10 stephenwilliams22