edward130603 / BayesSpace

Bayesian model for clustering and enhancing the resolution of spatial gene expression experiments.
http://edward130603.github.io/BayesSpace
Other
96 stars 20 forks source link

qTune/spatialCluster do not identify neighbours #120

Open drighelli opened 5 months ago

drighelli commented 5 months ago

Hi,

I'm trying to apply your method to some Visium datasets, but it always says returns 0 neighbours out of #spots.

There it is a reproducible example:

library(TENxVisiumData)
library(BayesSpace)
hbc <- HumanBreastCancerIDC()
hbc <- hbc[,hbc$sample_id=="HumanBreastCancerIDC1"]
hbc$row <- spatialCoords(hbc)[,2]
hbc$col <- spatialCoords(hbc)[,1]
hbc<-spatialPreprocess(hbc, platform="Visium")
hbc <- qTune(hbc, qs=seq(2, 20), platform="Visium", d=7)

Any clues on how to fix this?

Thank you in advance!

Dario

edward130603 commented 5 months ago

Hi Dario, BayesSpace uses both the array and pixel coordinates to find neighbors. Array coordinates go to row/col and pixel coordinages go to imagerow/imagecol.

DanielZucha commented 4 months ago

Hello, Thanks for the great package. I ran to the same of identifying 0 neighbors of #spots when analysing non-commercial ST technology. I overcame this issue by changing the ratio in the coordinate system (e.g. sce.spatial$row <- (sce.spatial$y_coord / 40) %>% round()), followed by screening for the number of neighboring spots with the find_neighbors() function.

Best, Daniel

mingYi-ch commented 2 weeks ago

Hi Dario, BayesSpace uses both the array and pixel coordinates to find neighbors. Array coordinates go to row/col and pixel coordinages go to imagerow/imagecol.

Hi, I tried both, but still Neighbors were identified for 0 out of 2488 spots, My neighouring radius is sqrt(9000).