<p>This issue may arise with earlier versions of clusterProfiler.</p>
<p>A solution is to re-install clusterProfiler : <code>BiocManager::install(&quot;clusterProfiler&quot;, force = TRUE)</code></p>
<p>Pay attention that updating your R or Bioconductor (and restart your R session) version may be needed as noted in the comments</p>

CC BY-SA 4.0
2023-10-09T09:19:51.687Z
2023-10-09T16:25:51.287Z
2023-10-09T16:25:51.287Z
Basti
<p><code>enrichKEGG()</code> expects entrez gene IDs so you will need to convert your gene identifiers to entrez identifiers first.</p>
<p>EDIT: Please see the answer by @Basti.</p>

CC BY-SA 4.0
2023-10-09T07:45:23.227Z
I've used this code previously and it has only worked using the locus_tags as thats what is input into KEGG for aja as far as I'm aware? Really confused why its not working now?
reltubycul
CC BY-SA 4.0
2023-10-09T07:28:28.173Z
2023-10-09T09:40:25.373Z
2023-10-09T09:40:25.373Z
haci
<p>I am trying EnrichKEGG on a few gene samples of genes to check it works before inputting the full genome:</p>
<p>This is my data input as test.csv</p>
<pre><code>id,fc
AJAP_14870,-0.04
AJAP_14875,0.32
AJAP_14880,-0.06
AJAP_14885,0.15
AJAP_14890,-0.52
AJAP_14895,-0.39
AJAP_14900,0.16
</code></pre>
<pre class="lang-r prettyprint-override"><code>geneList = test[,2]
names(geneList) = as.character(test[,1])
geneList = sort(geneList, decreasing = TRUE)

mygene &lt;- names(geneList)[abs(geneList) &gt; 2]

kk &lt;- enrichKEGG(gene         = mygene,
                 organism     = 'aja',
                 pvalueCutoff = 0.05)
</code></pre>
<p>There are no spaces in the gene names, I tested via</p>
<pre class="lang-r prettyprint-override"><code>print(head(test$ID), quote=TRUE)
</code></pre>
<p>But I get the error</p>
<pre class="lang-r prettyprint-override"><code>--&gt; No gene can be mapped....
--&gt; Expected input gene ID:
--&gt; return NULL...
</code></pre>
<p>I also tried installing through other means</p>
<pre class="lang-r prettyprint-override"><code>getOption(&quot;clusterProfiler.download.method&quot;)
#[1] &quot;libcurl&quot;
install.packages(&quot;R.utils&quot;)
library(R.utils)
R.utils::setOption(&quot;clusterProfiler.download.method&quot;,&quot;auto&quot;)
</code></pre>
<p>but that gives me the same error when I run the code. Any ideas how to fix this?</p>
<p>Thanks</p>

CC BY-SA 4.0
2023-10-09T07:40:31.170Z
Your code produces no error on my machine, what is your clusterProfiler version ?
Basti
CC BY-SA 4.0
2023-10-09T07:42:43.730Z
@Basti Thanks so much for getting back to me!!

> packageVersion("clusterProfiler")
[1] ‘4.2.2’
reltubycul
CC BY-SA 4.0
2023-10-09T07:49:48.170Z
Maybe you could try `BiocManager::install("clusterProfiler", force = TRUE)`as mine is ‘4.7.1’ and restart your R session
Basti
CC BY-SA 4.0
2023-10-09T08:05:36.250Z
@Basti Thanks for this! I tried that but it still just says version 4.2.2??
reltubycul
CC BY-SA 4.0
2023-10-09T08:35:36.097Z
Could you share your sessionInfo() in your post ? Maybe your R version or Bioconductor version is incompatible with latest clusterProfiler version.
Basti
CC BY-SA 4.0
2023-10-09T08:43:42.470Z
@Basti you're absolutely right - I've just had to update rtools, biocmanager and R! It's working now! Thanks so much for your help!! The relief haha
reltubycul
CC BY-SA 4.0
2023-10-09T09:02:08.927Z
No worries, I hope you will get good results!
Basti
CC BY-SA 4.0
2023-10-09T09:03:35.483Z
@Basti, would you mind converting your comments to an answer? It would be more visible.
haci
<r><bioconductor><clusterprofiler>
How to fix "No gene can be mapped, Expected input gene ID, return NULL..." error in clusterProfiler?
# How to fix "No gene can be mapped, Expected input gene ID, return NULL..." error in clusterProfiler?

(Asked by: username_0 on 2023-10-09)

I am trying EnrichKEGG on a few gene samples of genes to check it works before inputting the full genome:
This is my data input as test.csv
id,fc
AJAP_14870,-0.04
AJAP_14875,0.32
AJAP_14880,-0.06
AJAP_14885,0.15
AJAP_14890,-0.52
AJAP_14895,-0.39
AJAP_14900,0.16

geneList = test[,2]
names(geneList) = as.character(test[,1])
geneList = sort(geneList, decreasing = TRUE)

mygene <- names(geneList)[abs(geneList) > 2]

kk <- enrichKEGG(gene         = mygene,
                 organism     = 'aja',
                 pvalueCutoff = 0.05)

There are no spaces in the gene names, I tested via
print(head(test$ID), quote=TRUE)

But I get the error
--> No gene can be mapped....
--> Expected input gene ID:
--> return NULL...

I also tried installing through other means
getOption("clusterProfiler.download.method")
#[1] "libcurl"
install.packages("R.utils")
library(R.utils)
R.utils::setOption("clusterProfiler.download.method","auto")

but that gives me the same error when I run the code. Any ideas how to fix this?
Thanks

**Tags:** r, bioconductor, clusterprofiler
> **Comments:**
> **username_1**: Your code produces no error on my machine, what is your clusterProfiler version ?  
> **username_0**: @Basti Thanks so much for getting back to me!!  > packageVersion("clusterProfiler") [1] ‘4.2.2’  
> **username_1**: Maybe you could try `BiocManager::install("clusterProfiler", force = TRUE)`as mine is ‘4.7.1’ and restart your R session  
> **username_0**: @Basti Thanks for this! I tried that but it still just says version 4.2.2??  
> **username_1**: Could you share your sessionInfo() in your post ? Maybe your R version or Bioconductor version is incompatible with latest clusterProfiler version.  
> **username_0**: @Basti you're absolutely right - I've just had to update rtools, biocmanager and R! It's working now! Thanks so much for your help!! The relief haha  
> **username_1**: No worries, I hope you will get good results!  
> **username_2**: @Basti, would you mind converting your comments to an answer? It would be more visible.  

---

## 2 answers

### Answer by username_1 on 2023-10-09. Score: 3

This issue may arise with earlier versions of clusterProfiler.

A solution is to re-install clusterProfiler : `BiocManager::install("clusterProfiler", force = TRUE)`

Pay attention that updating your R or Bioconductor (and restart your R session) version may be needed as noted in the comments


---

### Answer by username_2 on 2023-10-09. Score: 1

`enrichKEGG()` expects entrez gene IDs so you will need to convert your gene identifiers to entrez identifiers first.

EDIT: Please see the answer by @Basti.

> **Comments:**
> **username_0**: I've used this code previously and it has only worked using the locus_tags as thats what is input into KEGG for aja as far as I'm aware? Really confused why its not working now?  

---

