Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-09T09:19:51.687Z
Answers.LastActivityDate: 2023-10-09T16:25:51.287Z
Answers.LastEditDate: 2023-10-09T16:25:51.287Z
Answers.UserDisplayName: Basti
Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-09T07:45:23.227Z
Answers.Text: 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?
Answers.UserDisplayName: reltubycul
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-09T07:28:28.173Z
Answers.LastActivityDate: 2023-10-09T09:40:25.373Z
Answers.LastEditDate: 2023-10-09T09:40:25.373Z
Answers.UserDisplayName: haci
Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-09T07:40:31.170Z
Comments.Text: Your code produces no error on my machine, what is your clusterProfiler version ?
Comments.UserDisplayName: Basti
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-09T07:42:43.730Z
Comments.Text: @Basti Thanks so much for getting back to me!!
  
  > packageVersion("clusterProfiler")
  [1] ‘4.2.2’
Comments.UserDisplayName: reltubycul
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-09T07:49:48.170Z
Comments.Text: Maybe you could try `BiocManager::install("clusterProfiler", force = TRUE)`as mine is ‘4.7.1’ and restart your R session
Comments.UserDisplayName: Basti
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-09T08:05:36.250Z
Comments.Text: @Basti Thanks for this! I tried that but it still just says version 4.2.2??
Comments.UserDisplayName: reltubycul
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-09T08:35:36.097Z
Comments.Text: Could you share your sessionInfo() in your post ? Maybe your R version or Bioconductor version is incompatible with latest clusterProfiler version.
Comments.UserDisplayName: Basti
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-09T08:43:42.470Z
Comments.Text: @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
Comments.UserDisplayName: reltubycul
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-09T09:02:08.927Z
Comments.Text: No worries, I hope you will get good results!
Comments.UserDisplayName: Basti
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-09T09:03:35.483Z
Comments.Text: @Basti, would you mind converting your comments to an answer? It would be more visible.
Comments.UserDisplayName: haci
Tags: <r><bioconductor><clusterprofiler>
Title: How to fix "No gene can be mapped, Expected input gene ID, return NULL..." error in clusterProfiler?
ThreadText: # 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
  
  ```
  
  ```r
  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
  
  ```r
  print(head(test$ID), quote=TRUE)
  
  ```
  
  But I get the error
  
  ```r
  --> No gene can be mapped....
  --> Expected input gene ID:
  --> return NULL...
  
  ```
  
  I also tried installing through other means
  
  ```r
  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**: @username_1 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**: @username_1 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**: @username_1 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**: @username_1, 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 @username_1.
  
  > **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?  
  
  ---
  
  