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

Error in spatialCluster #119

Open littlecabiria opened 5 months ago

littlecabiria commented 5 months ago

Hi Team, just a quick question that it seems like there are some errors when I was running the spatialCluster() function. I supposed that there are some errors in my sce object but I still tried to find it. Could someone help me please?

>   sim_sce <- spatialPreprocess(
+     sim_sce,
+     platform = plat,
+     n.PCs = 7,
+     n.HVGs = 150,
+     skip.PCA = FALSE,
+     log.normalize = TRUE,
+     assay.type = "logcounts"
+   )
Warning message:
In regularize.values(x, y, ties, missing(ties), na.rm = na.rm) :
  collapsing to unique 'x' values
>   single_sim_SRT <- BayesSpace::spatialCluster(sce=sim_sce, 
+                                    q=length(unique(real_sce@colData$spatial.cluster)), 
+                                    d=7, 
+                                    platform=plat, 
+                                    nrep=50000, 
+                                    gamma=2)
Neighbors were identified for 0 out of 278 spots.
Fitting model...
Error: Not compatible with requested type: [type=NULL; target=double].

false_sce.rds.zip

edward130603 commented 5 months ago

your simulated PCA matrix has a singular covariance matrix. probably need to change up your data generating steps to make it more realistic.

side note, BayesSpace isn't finding neighbors on your data here, so it won't end up doing any spatial smoothing. you will need to edit the code to detect neighbors.