broadinstitute / Tangram

Spatial alignment of single cell transcriptomic data.
BSD 3-Clause "New" or "Revised" License
246 stars 50 forks source link

Annotating cluster labels after cell segmentation on Visium #83

Open Qirongmao97 opened 1 year ago

Qirongmao97 commented 1 year ago

Hi, I had some questions about the cluster annotation after cell segmentation

I tried to map the single-cell data to Visium and got the probability of the spatial location of cell group ExcNeurons3, VLMC, and NB1, showing these clusters have clear spatial patterns and are highly enriched near the dentate gyrus areas.

Then I used the watershed algorithm to segment the image and try to annotate these segment cells, and the results of ExcNeurons3, VLMC, and NB1 didn't align with the pattern shown in the probability distribution before segmentation.

I was wondering if these results make sense to you and how Tangram works for annotating cluster labels after cell segmentation. Thanks!

image image

lewlin commented 1 year ago

You got nice patterns - thanks for using Tangram. To validate your result, it'd be better to consult a biologist as our team is composed of method developers / comp bio / AI scientists. Another way to validate, would be to see how much gene expression you predict on genes you have not used for mapping, as shown in the tutorial.

cynthier commented 1 year ago

Hello, I meet with this problem also. In image analysis part, I performed cell segmentation on my Visium data, and the the value of "cell count" is so low that it seem few nucleis are detected. It is so weird because all results before this step look good.

Are there some parameters or methods I could use in Tangram to improve the cell count number? Thanks in advance.

img: ImageContainer object with 1 layer: image: y (2000), x (1882), z (1), channels (3)

sq.im.process(img=img, layer="image") sq.im.segment( img=img, layer="image_smooth", method="watershed", channel=0 )

features_kwargs = { "segmentation": { "label_layer": "segmented_watershed", "props": ["label", "centroid"], "channels": [1,2], } }

sq.im.calculate_image_features( ad_sp, img, layer="image",key_added="image_features", features_kwargs=features_kwargs, features="segmentation",mask_circle=True, )

ad_sp.obs["cell_count"] = ad_sp.obsm["image_features"]["segmentation_label"] sc.pl.spatial(ad_sp, color=["clusters", "cell_count"], frameon=False)

Snipaste_2023-02-10_17-19-31

Finally, when I visualized the cells in segmentation_data, it only presents few cells. Snipaste_2023-02-10_19-32-41

gaddamshreya commented 1 year ago

Hi @cynthier,

Yes, definitely! You can improve segmentation on H&E images by using different segmentation algorithms. In the tutorial we use 'watershed' algorithm, you can also use cellpose or stardist. Segmentation would be significantly better if you can use full resolution H&E images as well. Please let me know if these methods work for you.

-Shreya