MarcElosua / SPOTlight

Spatial Transcriptomics Capture Location Deconvolution
https://marcelosua.github.io/SPOTlight
GNU General Public License v3.0
164 stars 25 forks source link

residuals of the sum of squares doesn't work for Seurat object #101

Closed MirDom closed 1 year ago

MirDom commented 1 year ago

Hi, i am following your tutorial on https://bioconductor.org/packages/devel/bioc/vignettes/SPOTlight/inst/doc/SPOTlight_kidney.html#loading-the-data to analyze data saved as Seurat object of spatial transcriptomics data. Everything works up untill the last step 4.5 Residuals. When trying to run the command (where B2 is my seurat object, instead of spe as in tutorial):

B2$res_ss <- res[[2]][colnames(B2)] xy <- spatialCoords(spe) B2$x <- xy[, 1] B2$y <- xy[, 2] ggcells(B2, aes(x, y, color = res_ss)) + geom_point() + scale_color_viridis_c() + coord_fixed() + theme_bw()

it gives the following error:

Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘spatialCoords’ for signature ‘"Seurat"’.

I assume it stems inherently from Seurat object features because when I run the same command for spe object as in the tutorial it works fine. Am I correct in my assumption? Have anyone tried this command on seurat object of spatial transcriptomics data?

MarcElosua commented 1 year ago

Hi @MirDom

Thank you very much for your interest in SPOTlight!

Your issue here is that you are trying to use the ggcells() function which is part of the scater package. This functino doesn't accept Seurat objects as an input, hence the error:

Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘spatialCoords’ for signature ‘"Seurat"’.

For Seurat I suggest using the standards FeaturePlot() function to plot it, Hope this helps, Marc

Han117 commented 1 year ago

Hi Marc, I found datas (allen_cortex_dwn.rds、markers_anterior.RDS、spotlight_ls_anterior.RDS、tissue_lowres_image.png) in your SPOTlight-spotlight-0.1.7 project on github, but the posterior data and its spatial slices are missing.

I am looking forward to your posterior data and its spatial slices.

When we analyze the anterior and posterior of ST data, both using scRNA-seq allen_cortex_dwn.rds ?

Should we analyze adult mouse anterior ST data and posterior ST data using the same scRNA-seq data( allen_cortex_dwn.rds   )?

best wishes!

------------------ 原始邮件 ------------------ 发件人: "MarcElosua/SPOTlight" @.>; 发送时间: 2023年9月22日(星期五) 凌晨0:18 @.>; @.***>; 主题: Re: [MarcElosua/SPOTlight] residuals of the sum of squares doesn't work for Seurat object (Issue #101)

Hi @MirDom

Thank you very much for your interest in SPOTlight!

Your issue here is that you are trying to use the ggcells() function which is part of the scater package. This functino doesn't accept Seurat objects as an input, hence the error:

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>