STOmics / SAW

GNU General Public License v3.0
134 stars 34 forks source link

DAPI staining that match with cellbin cell coordinates #132

Open YiqianGu opened 2 months ago

YiqianGu commented 2 months ago

Hi team,

I wish to use DAPI as image background, overlapped with spatial cell plots (such as the one generated using data.plt.spatial_scatter()). The data is processed with cellbin. The goal is select specific cells based on DAPI images, so I want to make sure the coordinates of DAPI image can be mapped with cell x and y coordinates. Could you let me know which DAPI image should I use? I tried ssDNA_XXX_regist.tif and ssDNA_fov_stitched_transformed.tif, however, they can not be mapped with cell x and y coordinates. The tif files seem to have more black margins. I attached a figure for your reference. Red dots are cells obtained from cellbin, background is ssDNA_fov_stitched_transformed.tif.

Screenshot 2024-07-23 at 12 06 22 PM
Clouate commented 2 months ago

Hi, may I ask how did you acquire the image of cell regions(red dots)? Normally, mask.tif in the SAW 03.register directory is the image of cell regions, and its coordinates could match the coordinates of regist.tif, because it was segmented based on the SN*regist.tif.

YiqianGu commented 2 months ago

Hi Clouate, the red dots are generated from cell coordinates.

I first converted cellbin gef to Seurat object using following this tutorial: https://stereopy.readthedocs.io/en/latest/Tutorials/Format_Conversion.html

Then find x and y coordinates with seurat_object@meta.data$x , seurat_object@meta.data$y.

Finally generate a scatter plot using ggplot with x and y coordinates.

The goal is to obtain specific cell IDs based on background DAPI staining.

Thank you!

Clouate commented 2 months ago

@YiqianGu Hi, if your cellbin.gef was output by the SAW standard pipeline, then the coordinates in 03.register/ regist.tif, 03.register/ mask.tif, and cellbin.gef(with a few offsets) will all correspond. I'm not sure what the effect is after comparing with *regist.tif? Could you show me your detailed R code? And if you want to display cellbin.gef together with DAPI background, you could try using Stereopy's data.plt.cells_plotting function.