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

runBayesSpaceClustering #193

Open
schak-ukf opened this issue Oct 28, 2024 · 9 comments
Open

runBayesSpaceClustering #193

schak-ukf opened this issue Oct 28, 2024 · 9 comments

Comments

@schak-ukf
Copy link

schak-ukf commented Oct 28, 2024

When I tried to run runBayesSpaceClustering, I encountered the following error: "spot_df" not found!

Here is the error:

run the pipeline

spata_obj <-

  • runBayesSpaceClustering(
  • object = spata_obj, 
    
  • name = "bayes_space", # the name of the output grouping variable
    
  • qs = 5
    
  • )
    Error: object 'spot_df' not found

Spata 2.0 version is: 3.1.1 and Seurat Version is 5.0. Can you please recommend some steps to overcome the error.?

@wuxiangning
Copy link

Hello, have you resolved this issue? I recently encountered the exact same problem.

@kueckelj kueckelj mentioned this issue Nov 3, 2024
@kueckelj
Copy link
Collaborator

kueckelj commented Nov 3, 2024

Hello, can you reinstall the package and see if the error persists?

@wuxiangning
Copy link

Hello!Should I directly download this new version you updated today? Or maybe I can simply update the existing package without uninstalling and reinstalling it?
{25A8CE76-13B9-4B78-AAED-2290AA5B9DEF}

@wuxiangning
Copy link

Hello!
I reinstalled it, but it still requires reinstalling the batch and another model package in order to start fitting. It seems that this will successfully enable Bayesian clustering.
Here r my codes:
devtools::install_github("theMILOlab/SPATA2")
devtools::install_github("theMILOlab/SPATA2","dev")
packageVersion("SPATA2")
install.packages("xgboost")
object <-

  • runBayesSpaceClustering(
  • object = object,
    
  • name = "bayes_space", # the name of the output grouping variable
    
  • qs = 5
    
  • )
    16:59:11 Running BayesSpace::spatialPreprocess().
    17:01:19 Using input for q: 5.
    17:01:19 Running BayesSpace::spatialCluster().
    Neighbors were identified for 4733 out of 4733 spots.
    Fitting model...

@wuxiangning
Copy link

However, when I reinstalled to version 3.1.2, I encountered new issues.
I found that I could not directly invoke asSPATA2 to convert the Seurat object as I did with version 3.0.1. Additionally, if I try to eliminate this bug by reinstalling with devtools::install_github("theMILOlab/SPATA2", "dev"), my SPATA2 automatically reverts back to version 3.0.1. This seems to be an unsolvable problem.
packageVersion("SPATA2")
[1] ‘3.1.2’
object<- asSPATA2(

  • object = seurat_object,
  • sample_name = "P9T_Spatial",
  • platform = "VisiumSmall",
  • img_name = "image",
  • img_scale_fct = "hires",
  • assay_name = "Spatial",
  • assay_modality = "gene",
  • verbose = TRUE
  • )
    17:49:05 Initiating SPATA2 object of spatial platform: VisiumSmall
    17:49:05 Transferring data.
    Error in (function (classes, fdef, mtable) :
    函数‘asMolecularAssay’标签‘"Assay"’找不到继承方法

@kueckelj
Copy link
Collaborator

kueckelj commented Nov 4, 2024

Hello, unfortunately I can not reproduce the error you mentioned with v3.1.2. Maybe it has something to do with some specifics about your object I am not aware of. How did you create the Seurat object? I assume with Seurat::Load10X_Spatial()? Do you have multiple assays stored in the Seurat object? I am asking, because you are specifying assay_name which is not necessary if you have only one assay. Regardless, can you provide some more details about the Seurat object?

@wuxiangning
Copy link

Hello!
Since my spatial transcriptomics file is an RDS file rather than the traditional H5 file, I actually loaded it using the RDS reading method. My Seurat object also contains only one assay. Here is my loading code and the detailed components of the Seurat object:
Code:
library(SPATA2)
library(SeuratData)
P9T_Spatial <- readRDS("F:\数据分析\Rdata\原始data\JH空转data\空间转录组\P9T_Spatial.rds.gz")
SpatialFeaturePlot(P9T_Spatial, features = "nCount_Spatial") + theme(legend.position = "right")

SpatialFeaturePlot(P9T_Spatial, features = "nCount_Spatial") + theme(legend.position = "right")
spata_obj <- asSPATA2(

  • object = P9T_Spatial,
  • sample_name = "P9T_Spatial",
  • platform = "VisiumSmall",
  • img_name = "image",
  • img_scale_fct = "hires",
  • assay_name = "Spatial",
  • assay_modality = "gene",
  • verbose = TRUE
  • )
    21:38:32 Initiating SPATA2 object of spatial platform: VisiumSmall
    21:38:32 Transferring data.
    21:38:34 Active assay: 'gene'.
    21:38:34 No directory was specified to store the image. Unloading won't be possible. Set with setImageDir().
    21:38:34 Active image: 'image'.
    21:38:34 Computing pixel scale factor.
    21:38:41 Done.
    警告信息:
    1: In .local(object, ...) :
    Assay 'Spatial' is in outdated Seurat format and will be converted to Seurat v5.
    2: In value[3L] : Could not find or transfer TSNE data.

{5148E16F-AF3D-4782-80CC-D072DB68CEB7}
{BCFF8102-674C-4720-8123-940748996B13}

@kueckelj
Copy link
Collaborator

kueckelj commented Nov 9, 2024

As I mentioned in issue #194 it would be helpful if you can somehow provide the Seurat object since I can not reproduce the issues. Is that possible?

@kueckelj
Copy link
Collaborator

Can you open a new clean R session, install SPATA2 with devtools::install_github("kueckelj/SPATA2"), load SPATA2 with library(SPATA2), and see if the problem persists?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants