Closed marvinquiet closed 1 year ago
Thank you very much Wenjing! I just updated the package and the output from SpatialPCA_SpatialPCs
, the object@SpatialPCs
, is now a regular matrix
instead of a dgeMatrix
. Please feel free to let me know if you find any other questions, thanks!
Best, Lulu
Hi Lulu,
Thanks for developing such as great method! From my user experience, spatialPCA is very robust, efficient, and accurate.
When running spatialPCA on my data (with a large sample size), I followed the tutorial of slideseq. In
clusterlabel = louvain_clustering(clusternum=8,latent_dat=object@SpatialPCs,knearest=round(sqrt(dim(object@SpatialPCs)[2])) )
, I encountered an errorError in t.default(PCvalues):argument is not a matrix
.I went over the function and noticed that
PCvalues
, which is equivalent toobject@SpatialPCs
is not a matrix but adgeMatrix
. https://github.com/shangll123/SpatialPCA/blob/9d96c32ef65976a16b80a1697ba8879cb3929121/R/SpatialPCA_utilties.R#L68Therefore, a potential workaround is to pass
as.matrix(object@SpatialPCs)
to the clustering function and problem will be solved.In case other people also encounter this issue, I decided to post it here. Please feel free to close the issue as this is a simple resolution and does not affect the overall procedure.
Sincerely, Wenjing