Add cells tutorial - #168
Conversation
Remove local cluster/home paths from cell outputs, drop the warnings.filterwarnings cell, and untrack pixi.toml so the PR contains only the create_cells_dataset notebook. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
- Register create_cells_dataset.ipynb in the Intermediate gallery section (fixes the RTD orphan-toctree warning under fail_on_warning) - Add 3:2 thumbnail for the gallery card - Localize paths in outputs, dedupe markdown, fix zarr write/read cell Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The notebook looks very good to me, thanks! I have some comments for minor fixes, let's merge soon then. Comments:
|
- Derive red Rectangle from shared bbox_min/bbox_max so it matches the bounding_box crop (Luca's comment) - Fix swallowed <Delayed> tag / stray space in dataset summary - SpatialData.datasets -> spatialdata.datasets (correct casing) - Replace unclear 'baked' wording with explicit rasterize phrasing Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Preserve H&E channel names (r/g/b) on he_aligned via c_coords - Anonymise local zarr-store paths in outputs (-> ./cells.zarr) - Remove blanket warnings.filterwarnings and unused ski/np imports - Correct table<->region wording (labels via region/instance, cell_id bridge to shapes) - Revert overview rectangle to the larger context box Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ajkswamy
left a comment
There was a problem hiding this comment.
Thanks @timtreis for this nice notebook. I went through it's current state and it's a very valuable example that illustrates how to visualize, subset and save a xenium 3.0.0 dataset using spatialdata framework.
I downloaded the raw data needed (~38GB) and tried to run it on my linux laptop, but the kernel crashed as the OS ran out of RAM (16GB + 20GB Swap). Here are my observations:
- Please link the associated PR on
spatialdata. - The cell with imports fails with
ModuleNotFoundError: No module named 'spatialdata_io'. Could we add it to the dependencies of this repo? - I think this notebook it too heavy for an average user to run it locally, as it needs the user to download a large amount of raw data (~38GB) and use more than 36GB of RAM to run the notebook (my kernel crashed at the bounding-box query step). One idea is to split it into
download.py,to_zarr.py, etc as has been done for other datasets in spatialdata-sandbox to save the subsetted SpatialData object to zarr. This notebook could then start by downloading that zarr from our datasets list, loading it etc. However, I am not very sure about this. @LucaMarconato what do you think here? How would this concern affect testing this notebook onspatialdata-integration-testing?
I'm loading a very normal Xenium dataset though, it's not even that large 😅 I think typically people just run these things on their HPC and not private laptops. I generally don't think that this is a notebook a user will realistically want to run or even should run, especially since the cells dataset will be distributed via The notebook was more to document how it was created and where it came from. |
|
Thanks @timtreis and @ajkswamy for the code and review!
Good point, but luckily no need anymore now that scverse/spatialdata#1149 is merged.
I changed the title to
I agree.
Still, this is very important if we want to ensure that the notebook is tested by us via |
|
Downloaded the data via the new spatialdata-sandbox downloader. The notebook runs on my machine. I will finish reviewing and we can merge soon. |
|
@timtreis are you fine with Currently we have: Edit: ah ok it's done on purpose "Non-trivial transformations: he_image still carries its affine+translation Sequence as a lazy coordinate transformation, next to he_aligned, the same image after that transformation has been applied (rasterized) into pixel space, so both coordinate-system and rasterize/alignment code paths are represented.", great! |
|
Finished reviewing the notebook, looks great to me, ready to merge! |

This notebook describes the creation of the
cellsdataset which I hope ends up being a more biologically looking dataset that we can use for user-facing testing and small tutorials. Ideally it'd be distributed viaSpatialData, if out-of-scope it'll land viaSquidpy.I'm not sure where in the documentation it'd belong, but I feel like it should be public?