Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FeaturePlot for spatial transcriptomics data does not work #9481

Open
Yijia-Jiang opened this issue Nov 14, 2024 · 3 comments
Open

FeaturePlot for spatial transcriptomics data does not work #9481

Yijia-Jiang opened this issue Nov 14, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Yijia-Jiang
Copy link

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
@Yijia-Jiang Yijia-Jiang added the bug Something isn't working label Nov 14, 2024
@zskylarli
Copy link
Contributor

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
Copy link
Author

@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.

@alikhuseynov
Copy link

@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.

using pt.size.factor = 4 or similar should work for Visium HD.
check this:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants