theMILOlab / SPATA2

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

Error in getActiveMatrixName(object, verbose = FALSE) #106

Open YingXu-FDU opened 3 months ago

YingXu-FDU commented 3 months ago

Hi there, Im here to ask about the errors about the ’transformSeuratToSpata‘ function. Below is my codes and packages version if you need. Seurat Version 5.0. SPATA2 Version 2.0.4.

Here is the code. spata_obj <- initiateSpataObject_CountMtr(coords_df = coords_df,count_mtr = sce@assays$Spatial$counts, sample_name = "Name")

Here is the error messege. 21:49:38 Optimization finished 21:49:39 Setting up new spata2 object. 21:49:39 Neither object of class HistologyImaging nor image provivded. Slot @images remains empty. 21:49:39 Initiation finished. Error in getActiveMatrixName(object, verbose = FALSE) : Please set an active matrix with setActivenMatrix()

It seems that i should set the active matrix for the spata2 object, however, i couldnt run the initiateSpataObject_CountMtr to construct the object. how can i fix it? Many thanks.

simonmfr commented 3 months ago

Hi @YingXu-FDU,

transformSeuratToSpata is deprecated, please use asSPATA2() as described in our documentation: https://themilolab.github.io/SPATA2/articles/spata-v2-platform-compatibility.html

simonmfr commented 3 months ago

For initializing, please update SPATA2 and confuns, and try again.