satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.3k stars 918 forks source link

FeaturePlot for spatial transcriptomics data does not work #9481

Open Yijia-Jiang opened 1 week ago

Yijia-Jiang commented 1 week ago

Hello, I am trying Seurat for the latest visium HD data and trying to use SpatialFeaturePlot function. I used the exact same script shown in vignette for preprocessing, but the feature plot is just H&E image and there is no gene expression level displayed. Could you help with this? Thank you very much.

object <- Load10X_Spatial(data.dir = localdir)

# Setting default assay changes between 8um and 16um binning
Assays(object)
DefaultAssay(object) <- "Spatial"

head(object@meta.data)
vln.plot <- VlnPlot(object, features = "nCount_Spatial", pt.size = 0) + theme(axis.text = element_text(size = 4)) + NoLegend()
count.plot <- SpatialFeaturePlot(object, features = "nCount_Spatial") + theme(legend.position = "right")

# note that many spots have very few counts, in-part
# due to low cellular density in certain tissue regions
vln.plot | count.plot

length(rownames((object@assays$Spatial@features@.Data)))
# normalize both 8um and 16um bins
object <- NormalizeData(object)
object@assays$Spatial$data

p1 <- SpatialFeaturePlot(object, features = "CD3D") + ggtitle("CD3D expression (16um)")
p2 <- SpatialFeaturePlot(object, features = "CD4") + ggtitle("CD4 expression (16um)")
print(p1)
print(p2)
Screenshot 2024-11-14 at 10 23 05 AM
zskylarli commented 6 days ago

Hi! Could you try testing a few different numbers for the pt.size.factor argument of SpatialFeaturePlot to see if you are able to see the plotted values? I would recommend changing the value substantially (the current default is 1.6), such as tenfold, since it could just be a scaling factor issue. Also, have you tried using/ran into a similar issue with using SpatialDimPlot on the same data?

Yijia-Jiang commented 6 days ago

@zskylarli I ran a similar issue using the SpatialDimPlot on the same data. I also tried changing pt.size.factor but it was still the same.