gustaveroussy / sopa

Technology-invariant pipeline for spatial omics analysis (Xenium / Visium HD / MERSCOPE / CosMx / PhenoCycler / MACSima / ...) that scales to millions of cells
https://gustaveroussy.github.io/sopa/
BSD 3-Clause "New" or "Revised" License
129 stars 15 forks source link

CLI tutorial Baysor segmentation creates different number of patches #119

Closed Marius1311 closed 1 month ago

Marius1311 commented 1 month ago

Description

I'm running the CLI tutorial, and when I create patches for Baysor using sopa patchify baysor tuto.zarr --config-path config.toml --patch-width-microns 1200 --patch-overlap-microns 50

it creates only a single patch, contrary to the 4 patches the tutorial suggests. Where can I actually find the conversion from pixels to microns?

I played around a bit and found that sopa patchify baysor tuto.zarr --config-path config.toml --patch-width-microns 200 --patch-overlap-microns 20 actually gives 4 patches.

quentinblampey commented 1 month ago

Hello @Marius1311, I think I need to update the tutorial, you should indeed have only one patch!

Regarding the conversion from pixel to microns: you can look for the transformation from the microns coordinate system to the pixel coordinate system (they may have a different name depending on the technology you use). For instance, you can look at sdata["transcripts"].attrs (using the right name for "transcripts", depending on your SpatialData object). Note that Sopa handles the transformations as expected, so, normally, there is no need to worry about this!

Marius1311 commented 1 month ago

Thank you @quentinblampey !

quentinblampey commented 1 month ago

You're welcome, I'll close the issue!