theMILOlab / SPATA2

A Toolbox for Spatial Gene Expression Analysis
77 stars 15 forks source link

Unable to load any objects on SPATA2 #99

Open ssrinivasan2 opened 5 months ago

ssrinivasan2 commented 5 months ago

Hi,

I am new to this package and am trying to better visualize already processed Seurat Objects.

Similar to the other issues, I am unable to load any objects into SPATA2. I have tried uninstalling and re-installing SPATA2 and Seurat as well, but this did not change the issues. Could you please let me know if there is something I am doing wrong?

I am using R/4.3.2 and SPATA2 v2.0.4 and Seurat v5.0.1.

I have tried several commands from the GitHub tutorial:

  1. Loading Seurat objects

seurat_object <- SeuratData::LoadData("stxBrain", type = "anterior1") seurat_object <- Seurat::SCTransform(seurat_object, assay = "Spatial", verbose = FALSE)

spata2_object <- SPATA2::asSPATA2( object = seurat_object, sample_name = "mouse_brain", image_name = "anterior1", spatial_method = "Visium" )

  1. Loading 10x data directly

object_t275 <- initiateSpataObject_10X( directory_10X = "path/to/a/10Xvisium-folder", # the directory from which to load the data sample_name = "gbm-275" )

  1. Loading SPATA objects from SPATAdata

object_t269 <- downloadSpataObject(sample_name = "269_T")

In all three cases, I get this error:

Error in give_feedback(msg = msg, verbose = verbose, fdb.fn = fdb.fn, :

kueckelj commented 5 months ago

Hello, thanks for reaching out to us. Can you install confuns again and see if the error persists?

ssrinivasan2 commented 5 months ago

Hi Jan, thank you for your response! I reinstalled confuns, but the same error persists.

kueckelj commented 5 months ago

I am looking into it. I will come back to you in no time.

kueckelj commented 5 months ago

Can you install confuns again and try again?

healthgreat commented 3 months ago

I reinstalled Confuns, but if I load it from scratch using initiate SpataObject=10X, it still prompts Error in getActiveMatrixName (object, verbose=FALSE): Please set an active matrix with setActivenMatrix() I suspect that this setActivenMatrix is spelled incorrectly. Shouldn't it be setActiveMatrix?

devtools::install_github(repo = "kueckelj/confuns",force = TRUE) Downloading GitHub repo kueckelj/confuns@HEAD ── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────── ✔ checking for file 'C:\Users\Administrator\AppData\Local\Temp\RtmpCmCvtN\remotes1a1c77f7701e\kueckelj-confuns-3f03060/DESCRIPTION' ... ─ preparing 'confuns': (497ms) ✔ checking DESCRIPTION meta-information ... ─ checking for LF line-endings in source and make files and shell scripts (398ms) ─ checking for empty or unneeded directories ─ building 'confuns_1.0.3.tar.gz'

> object_t275 <-initiateSpataObject_10X(

Number of nodes: 3947 Number of edges: 152994

Running Louvain algorithm... 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| **| Maximum modularity in 10 random starts: 0.7921 Number of communities: 13 Elapsed time: 0 seconds 11:02:15 Running 'Seurat::RunTSNE()' with default parameters. 11:02:22 Running 'Seurat::RunUMAP()' with specified parameters. 11:02:22 UMAP embedding parameters a = 0.9922 b = 1.112 Found more than one class "dist" in cache; using the first, from namespace 'BiocGenerics' Also defined by ‘spam’ 11:02:22 Read 3947 rows and found 30 numeric columns 11:02:22 Using Annoy for neighbor search, n_neighbors = 30 Found more than one class "dist" in cache; using the first, from namespace 'BiocGenerics' Also defined by ‘spam’ 11:02:22 Building Annoy index with metric = cosine, n_trees = 50 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| **| 11:02:22 Writing NN index file to temp file C:\Users\ADMINI~1\AppData\Local\Temp\RtmpCmCvtN\file1a1c4d336de 11:02:22 Searching Annoy index using 1 thread, search_k = 3000 11:02:22 Annoy recall = 100% 11:02:23 Commencing smooth kNN distance calibration using 1 thread with target n_neighbors = 30 11:02:24 Initializing from normalized Laplacian + noise (using RSpectra) 11:02:24 Commencing optimization for 500 epochs, with 168256 positive edges Using method 'umap' 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| **| 11:02:33 Optimization finished 11:02:33 Initiating spata2 object. 11:02:33 Setting up new spata2 object. 11:02:33 Transferring data. 11:02:35 Done. 11:02:35 Saving. 11:02:35 No directory specified. Skip saving Seurat object. 11:02:35 Computing pixel scale factor. 11:02:35 Using center to center distance to compute pixel scale factor. 11:02:35 Computing barcode spot distances. 11:02:38 Done. Error in getActiveMatrixName(object, verbose = FALSE) : Please set an active matrix with setActivenMatrix() In addition: Warning message: Not validating Seurat objects

YingXu-FDU commented 3 months ago

Hi there, i met with the same problem. Error in getActiveMatrixName(object, verbose = FALSE) : Please set an active matrix with setActivenMatrix()

have you fixed it?

simonmfr commented 3 months ago

Thank you for raising this issue. Please update SPATA2 and confuns, and try again. It should work now.