irGSEA icon indicating copy to clipboard operation
irGSEA copied to clipboard

ERROR happened in irGSEA.integrate

Open xgwb opened this issue 1 year ago • 11 comments

Dear developer, It is nice to see such an amazing tools created , but there is something disturbing me . There is an error happened when I run irGSEA.integrate; here is my code : result.dge <- irGSEA.integrate(object = malignant,metadata = NULL,group.by = 'group', col.name = NULL,method = c("AUCell","UCell","singscore","ssgsea")) Calculate differential gene set : AUCell Calculate differential gene set : UCell Calculate differential gene set : singscore Calculate differential gene set : ssgsea Error in UseMethod("distinct") : no applicable method for 'distinct' applied to an object of class "NULL" In addition: Warning messages: 1: In FindMarkers.default(object = data.use, cells.1 = cells.1, cells.2 = cells.2, : No features pass logfc.threshold threshold; returning empty data.frame 2: In FindMarkers.default(object = data.use, cells.1 = cells.1, cells.2 = cells.2, : No features pass logfc.threshold threshold; returning empty data.frame How can I solve this problem?

xgwb avatar Mar 09 '24 08:03 xgwb

I have run such code : Idents(scRNA) <- scRNA$group

a <- Seurat::FindAllMarkers(object = scRNA, assay = "AUCell",

  •                         slot = "scale.data", 
    
  •                         test.use = "wilcox", min.pct = -Inf, logfc.threshold = 0,
    
  •                         min.cells.group = 0, min.diff.pct = -Inf, verbose = F,
    
  •                         min.cells.feature = 0)
    

For a (much!) faster implementation of the Wilcoxon Rank Sum Test, (default method for FindMarkers) please install the presto package

install.packages('devtools') devtools::install_github('immunogenomics/presto')

After installation of presto, Seurat will automatically use the more efficient implementation (no further action necessary). This message will be shown once per session 差异通路非常的显著

xgwb avatar Mar 09 '24 08:03 xgwb

方便分享你的数据吗?可以加我的微信fcq065837测试一下是哪里出了问题。

chuiqin avatar Mar 09 '24 10:03 chuiqin

我使用了官方pbmc数据,结果如下: result.dge <- irGSEA.integrate(object = pbmc3k.final,

  •                            group.by = "seurat_annotations",
    
  •                            metadata = NULL, col.name = NULL,
    
  •                            method = c("AUCell","UCell","singscore",
    
  •                                       "ssgsea", "JASMINE", "viper"))
    

Calculate differential gene set : AUCell Calculate differential gene set : UCell Calculate differential gene set : singscore Calculate differential gene set : ssgsea Calculate differential gene set : JASMINE Calculate differential gene set : viper Error in UseMethod("distinct") : no applicable method for 'distinct' applied to an object of class "NULL" In addition: Warning messages: 1: In mean.fxn(object[features, cells.1, drop = FALSE]) : NaNs produced 2: In mean.fxn(object[features, cells.2, drop = FALSE]) : NaNs produced 3: In mean.fxn(object[features, cells.1, drop = FALSE]) : NaNs produced 4: In mean.fxn(object[features, cells.2, drop = FALSE]) : NaNs produced

xgwb avatar Mar 09 '24 15:03 xgwb

我怀疑是R包安装出错,但是我重装了所有官方要求的包以后仍然报错

xgwb avatar Mar 09 '24 15:03 xgwb

这让人感觉不可思议,pbmc3k.final示例数据2天前测试过,是没有问题的。 你可以先检查一下是否有seurat_annotations这一列存在,以及随机挑选一个Assay验证一下是否存在,可以这样操作:

unique(pbmc3k.final$seurat_annotations
pbmc3k.final[["AUCell"]]@scale.data[1:2,1:2]

chuiqin avatar Mar 09 '24 15:03 chuiqin

我运行了这些代码,结果如下: unique(pbmc3k.final$seurat_annotations) [1] Memory CD4 T B CD14+ Mono NK CD8 T Naive CD4 T FCGR3A+ Mono DC Platelet
Levels: Naive CD4 T Memory CD4 T CD14+ Mono B CD8 T FCGR3A+ Mono NK DC Platelet

   pbmc3k.final[["AUCell"]]@scale.data[1:2,1:2]
                         AAACATACAACCAC AAACATTGAGCTAC

HALLMARK-ADIPOGENESIS 0.03405244 0.02949009 HALLMARK-ALLOGRAFT-REJECTION 0.10319892 0.13336782

xgwb avatar Mar 09 '24 17:03 xgwb

确实让人感觉意外,你可以加我微信号fcq065837,我们仔细排查一下错误,后续错误原因也会公布在这里。

chuiqin avatar Mar 10 '24 04:03 chuiqin

好的,谢谢您的帮助

xgwb avatar Mar 10 '24 06:03 xgwb

错误的发生是因为Seurat从5.02开始,增加了一个fc.slot参数。如果你要计算scale.data的差异,不管是FindAllMarkers还是FindMarkers函数,没有指定fc.slot,计算的时候都会出错。恰好irGSEA的打分矩阵都存放在scale.data里面。 我在新版本的irGSEA(3.2.4)里面已经修复了这个错误,只要重新安装即可解决这个问题。

4146ca0abae6458eddbd1ef73512e6a

chuiqin avatar Mar 10 '24 11:03 chuiqin

我也遇到了同样的问题,但可能与irGSEA版本无关,而是运行内存。我所用的服务器R版本是4.1.0,irGSEA 3.2.6,dplyr 1.1.6,但仍提示相同的报错。于是我在其他帖子给出的解决方法,设置了options,并转后台运行,成功解决了非版本问题: options(future.globals.maxSize = 100000 * 1024^5) job::job({result.age <- irGSEA.integrate(object = rds, group.by = "age", #根据年龄分组,也可根据cluster_name,或者其他的条件 method = c("UCell","singscore", "ssgsea"),metadata = NULL, col.name = NULL)}) 1713409600753

Taxols1996 avatar Apr 18 '24 03:04 Taxols1996