clusterProfiler icon indicating copy to clipboard operation
clusterProfiler copied to clipboard

"No gene can be mapped" using enricher even under latest clusterprofiler v4.9.0.002

Open Ziwei-Liu opened this issue 2 years ago • 3 comments

I want to use the enricher function to enrich positively selected genes from a local made own database. But the code that properly worked last month breaks now. I've checked everywhere for solution, and updated all that can be updated, while it still remains unsolved.

Version of R & clusterprofiler: R 4.3.0 clusterprofiler v4.9.0.002 DOSE v3.26.1

And it's my screen info:

> library(clusterProfiler)

clusterProfiler v4.9.0.002  For help: https://yulab-smu.top/biomedical-knowledge-mining-book/

If you use clusterProfiler in published research, please cite:
T Wu, E Hu, S Xu, M Chen, P Guo, Z Dai, T Feng, L Zhou, W Tang, L Zhan, X Fu, S Liu, X Bo, and G Yu. clusterProfiler 4.0: A universal enrichment tool for interpreting omics data. The Innovation. 2021, 2(3):100141

载入程辑包:‘clusterProfiler’

The following object is masked from ‘package:stats’:

    filter

> gene <- read.table('positive_selected.gene.list')
> head(gene)
           V1
1 LG20G000295
2 LG22G000409
3 LG10G000121
4 LG20G000337
5 LG06G000779
6 LG15G000650
> term2gene <- read.table('ko_2_gene.txt')
> head(term2gene)
       V1          V2
1 ko00010 LG07G000819
2 ko00010 LG10G000478
3 ko00010 LG27G000486
4 ko00010 LG16G000507
5 ko00010 LG22G000478
6 ko00010 LG28G000107
> term2name <- read.table('ko_2_disc.txt', sep = '\t')
> head(term2name)
       V1                                       V2
1 ko00010             Glycolysis / Gluconeogenesis
2 ko00020                Citrate cycle (TCA cycle)
3 ko00030                Pentose phosphate pathway
4 ko00040 Pentose and glucuronate interconversions
5 ko00051          Fructose and mannose metabolism
6 ko00052                     Galactose metabolism
> x <- enricher(gene,TERM2GENE=term2gene,TERM2NAME=term2name,pvalueCutoff = 0.05, 
+               pAdjustMethod = "BH",qvalueCutoff = 0.05)
--> No gene can be mapped....
--> Expected input gene ID: LG13G000280,LG23G000797,LG10G000762,LG36G000159,LG10G000082,LG30G000189
--> return NULL...

Ziwei-Liu avatar Jun 02 '23 09:06 Ziwei-Liu

Try this one:

x <- enricher(gene$V1,TERM2GENE=term2gene,TERM2NAME=term2name,pvalueCutoff = 0.05, 
               pAdjustMethod = "BH",qvalueCutoff = 0.05)

altairwei avatar Jun 02 '23 10:06 altairwei

Try this one:

x <- enricher(gene$V1,TERM2GENE=term2gene,TERM2NAME=term2name,pvalueCutoff = 0.05, 
               pAdjustMethod = "BH",qvalueCutoff = 0.05)

It works, thanks!

Ziwei-Liu avatar Jun 02 '23 10:06 Ziwei-Liu

You can also change read.table to readLines:

gene <- readLines('positive_selected.gene.list')

Because it looks like your gene list is not stored in tabular form.

altairwei avatar Jun 02 '23 11:06 altairwei