KChen-lab / gsdensity

9 stars 2 forks source link

Error when using compute.mca() function #2

Closed WinningStone closed 8 months ago

WinningStone commented 9 months ago

Hello I am using spatial transcriptomics data (visium) with seurat. I want use gsdensity to do Pathway centric analysis in my data. But I got error in compute.mca() function.

So I used tutorial data (brain) that if I made mistake, I want to find and fix it. But also in tutorial data same error occured.. Can you guys help me solve this error?? I will attach the code with error. Help me please. Thank you. tutorial data = https://htmlpreview.github.io/?https://github.com/qingnanl/gsdensity/blob/master/vignette/spatial_example_10x_visium.html

ce <- compute.mca(object = brain)

Performing log-normalization 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| **| Error in match.arg(arg = value, choices = Assays(object = object)) : 'arg' should be one of “Spatial”, “SCT”

YaoXinZhi commented 2 months ago

Hi @WinningStone I am having the same problem when I run the following code. Can you please tell me if you solved the problem. Thank you !

st_data An object of class Seurat 36602 features across 1211 samples within 2 assays Active assay: SCT (17365 features, 3000 variable features) 3 layers present: counts, data, scale.data 1 other assay present: Spatial 3 dimensional reductions calculated: pca, umap, tsne 1 spatial field of view present: slice1

Assays(st_data) [1] "Spatial" "SCT"

ce <- compute.mca(object = st_data) Performing log-normalization 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| **| Error in match.arg(arg = value, choices = Assays(object = object)) : 'arg' should be one of “Spatial”, “SCT”

YaoXinZhi commented 2 months ago

I have solved the following problem. Just as you must specify slot=“RNA” to process scRNA-seq data, you need to develop both assay and slot when processing ST data

ce <- compute.mca(object = st_data, assay = "SCT", slot = 'SCT')