chuiqin / irGSEA

The integration of single cell rank-based gene set enrichment analysis
Other
106 stars 17 forks source link

irGSEA.score多个signature运行报错 Error in relist(v, part) #22

Open amingson opened 1 year ago

amingson commented 1 year ago

尊敬的作者您好! 很感谢您开的这个工具为我提供了帮助与便利,今天我在运行irGSEA.score这个函数的时候发现含多个signature的geneset 会出现报错,如果让geneset只含有一个signature是能够正常运行的.以下是报错内容:

------------------------------------------------------------------------------------------------------------------------------------------

sce.ssgsea <- irGSEA.score(object = sce, assay = "RNA", slot = "data", seeds = 123, ncores = 60,msigdb=F, custom = T,

  • geneset = c5gsbp, method = c("ssgsea"), kcdf = 'Gaussian') Validating object structure Updating object slots Ensuring keys are in the proper structure Ensuring feature names don't have underscores or pipes Object representation is consistent with the most current Seurat version Calculate ssgsea scores Error in relist(v, part) : shape of 'skeleton' is not compatible with 'NROW(flesh)' 此外: Warning messages: 1: In .local(expr, gset.idx.list, ...) : Using 'dgCMatrix' objects as input is still in an experimental stage. 2: In .filterFeatures(expr, method) : 11 genes with constant expression values throuhgout the samples.

    ------------------------------------------------------------------------------------------------------------------------------------------

    希望能够得到您的帮助 ! 感谢

chuiqin commented 11 months ago

我很抱歉现在才回复你。之前在手机邮箱上直接回复issue,但直到今天登录网页才发现这个回复信息并没有出现在issue里面。请问你现在的问题解决了吗?

amingson commented 11 months ago

我很抱歉现在才回复你。之前在手机邮箱上直接回复issue,但直到今天登录网页才发现这个回复信息并没有出现在issue里面。请问你现在的问题解决了吗?

您好,感谢您的回复,后来经多次调试后,还是出现报错。list里面如果只包含一个对象是可以运行的 image

但是我没有去使用手册里面的命令检验是否是我的格式问题。

chuiqin commented 11 months ago

方便打印一下c5gsbp这个变量前几个的信息吗?我观察一下是否是格式出来问题。

amingson commented 11 months ago

方便打印一下c5gsbp这个变量前几个的信息吗?我观察一下是否是格式出来问题。

这边使用的是GSEA的signature image geneset的内容如下 image

chuiqin commented 11 months ago

我使用pbmc示例数据运行了你的代码,发现是可以正常运行的。

library(irGSEA)
library(GSVA)
library(GSEABase)
library(clusterProfiler)
c5gsbp <- read.gmt("./c5.go.bp.v2023.1.Hs.symbols.gmt")
c5gsbp <- split(c5gsbp, c5gsbp$term)
c5gsbp <- c5gsbp[1:5]
c5gsbp <- lapply(c5gsbp, function(x){
  x <- x$gene
  return(x)
})

library(Seurat)
library(SeuratData)
# loading dataset
data("pbmc3k.final")
pbmc3k.final <- UpdateSeuratObject(pbmc3k.final)
sce.ssgsea <- irGSEA.score(object = pbmc3k.final, assay = "RNA", slot = "data", 
                           seeds = 123, ncores = 60,msigdb=F, custom = T,
                           geneset = c5gsbp, method = c("ssgsea"), kcdf = 'Gaussian')
Assays(sce.ssgsea)
[1] "RNA"    "ssgsea"

image

然而,我的服务器有96个ncores和500G以上的运行内存。 我推测你运行失败的原因可能是,缺乏足够用多的核心以及内存。 你可以先尝试将ncores从60改为4,然后c5gsbp只取前5个,测试一下你的数据是否可以正常运行。假如你的数据特别大,比如object有30G以上,你还需要考虑一下4个核心下,你的内存是否是足够的。

amingson commented 11 months ago

我使用pbmc示例数据运行了你的代码,发现是可以正常运行的。

library(irGSEA)
library(GSVA)
library(GSEABase)
library(clusterProfiler)
c5gsbp <- read.gmt("./c5.go.bp.v2023.1.Hs.symbols.gmt")
c5gsbp <- split(c5gsbp, c5gsbp$term)
c5gsbp <- c5gsbp[1:5]
c5gsbp <- lapply(c5gsbp, function(x){
  x <- x$gene
  return(x)
})

library(Seurat)
library(SeuratData)
# loading dataset
data("pbmc3k.final")
pbmc3k.final <- UpdateSeuratObject(pbmc3k.final)
sce.ssgsea <- irGSEA.score(object = pbmc3k.final, assay = "RNA", slot = "data", 
                           seeds = 123, ncores = 60,msigdb=F, custom = T,
                           geneset = c5gsbp, method = c("ssgsea"), kcdf = 'Gaussian')
Assays(sce.ssgsea)
[1] "RNA"    "ssgsea"

image

然而,我的服务器有96个ncores和500G以上的运行内存。 我推测你运行失败的原因可能是,缺乏足够用多的核心以及内存。 你可以先尝试将ncores从60改为4,然后c5gsbp只取前5个,测试一下你的数据是否可以正常运行。假如你的数据特别大,比如object有30G以上,你还需要考虑一下4个核心下,你的内存是否是足够的。

感谢您的帮助,我的服务器配置跟您的一样。如果后续我再次运行这个分析,我按照您的建议进行调整,并给您反馈。 再次感谢您的帮助!!! 祝好。