<p>Conversion using <code>R</code>:</p>
<pre><code>library(biomaRt)

mart &lt;- useDataset(&quot;hsapiens_gene_ensembl&quot;, useMart(&quot;ensembl&quot;))

    genes &lt;- getBM(
      filters=&quot;ensembl_gene_id&quot;,
      attributes=c(&quot;ensembl_gene_id&quot;, &quot;entrezgene_id&quot;),
      values=ensembl.genes,
      mart=mart)
</code></pre>
<p>Where <code>ensembl.genes</code> is a vector of Ensembl gene IDs.</p>

CC BY-SA 4.0
2021-08-05T22:23:06.367Z
As of 2021-08-05, the attributes argument should be set to `attributes = c("ensembl_gene_id", "entrezgene_id")`. I believe that the `"_id"` appendage has been added to the attribute since this answer was first posted.
Gabriel J. Odom
CC BY-SA 4.0
2018-01-18T16:01:17.680Z
2023-09-07T16:15:48.133Z
2023-09-07T16:15:48.133Z
Peter
<p>The ID you need is the NCBI gene ID, which is the same as the EntrezGene ID. </p>

CC BY-SA 3.0
2017-09-06T11:29:32.903Z
Thank you Ian, it seems working. Anyway, there is no a one-to-one matching (i.e., some Ensembl IDs do not have an NCBI counterpart). Is it normal?
floatingpurr
CC BY-SA 3.0
2017-09-06T11:59:23.847Z
Yes. See my answer to your other question. https://bioinformatics.stackexchange.com/a/2474/235
Ian Sudbery
CC BY-SA 3.0
2017-09-06T11:22:30.280Z
2017-09-06T11:22:30.280Z
Ian Sudbery
<p>Well, I'm trying to convert a list of Human Gene referenced by Ensembl Gene IDs to Entrez Gene IDs. I <a href="https://bioinformatics.stackexchange.com/questions/2462/missing-data-mappings-in-mygene-info-while-trying-to-convert-genes-ensembl-ids-t">have been advised</a> to use <a href="http://www.ensembl.org/biomart/martview/" rel="noreferrer">biomart</a>.</p>

<p>I tried to get a kind of conversion table for all human genes. I don't know if my settings are wrong, but I didn't find any checkbox for Entrez Gene Id in the section <code>Attributes</code> > <code>External References</code>. I've just found the Entrez transcript name ID (see below), but it's not what I need.</p>

<p><a href="https://i.sstatic.net/VWtTT.png" rel="noreferrer"><img src="https://i.sstatic.net/VWtTT.png" alt="enter image description here"></a></p>

<p>How can I use <em>biomart</em> for such a conversion?</p>

<p><strong>Edit:</strong></p>

<p><strike>According to <a href="https://youtu.be/DXPaBdPM2vs?t=1m50s" rel="noreferrer">this video tutorial</a> EntrezGene ID should be an option in biomart (see screenshot below).</strike></p>

<p>That video tutorial is outdated.</p>

CC BY-SA 3.0
2017-09-06T11:50:38.200Z
That tutorial is 8 years old.
Emily_Ensembl
CC BY-SA 3.0
2017-09-06T11:55:22.653Z
Yes, @Emily_Ensembl. I'm sorry, I had gotten it from an old documentation page : )
floatingpurr
<gene><public-databases><biomart><conversion>
Converting Ensembl Gene IDs to Entrez Gene IDs through biomart
# Converting Ensembl Gene IDs to Entrez Gene IDs through biomart

(Asked by: username_0 on 2017-09-06)

Well, I'm trying to convert a list of Human Gene referenced by Ensembl Gene IDs to Entrez Gene IDs. I [have been advised](https://bioinformatics.stackexchange.com/questions/2462/missing-data-mappings-in-mygene-info-while-trying-to-convert-genes-ensembl-ids-t) to use [biomart](http://www.ensembl.org/biomart/martview/).

I tried to get a kind of conversion table for all human genes. I don't know if my settings are wrong, but I didn't find any checkbox for Entrez Gene Id in the section `Attributes` > `External References`. I've just found the Entrez transcript name ID (see below), but it's not what I need.

[![enter image description here](https://i.sstatic.net/VWtTT.png)](https://i.sstatic.net/VWtTT.png)

How can I use *biomart* for such a conversion?

**Edit:**

According to [this video tutorial](https://youtu.be/DXPaBdPM2vs?t=1m50s) EntrezGene ID should be an option in biomart (see screenshot below).

That video tutorial is outdated.

**Tags:** gene, public-databases, biomart, conversion
> **Comments:**
> **username_1**: That tutorial is 8 years old.  
> **username_0**: Yes, @Emily_Ensembl. I'm sorry, I had gotten it from an old documentation page : )  

---

## 2 answers

### Answer by username_4 on 2017-09-06. Score: 8 | Accepted answer

The ID you need is the NCBI gene ID, which is the same as the EntrezGene ID.

> **Comments:**
> **username_0**: Thank you Ian, it seems working. Anyway, there is no a one-to-one matching (i.e., some Ensembl IDs do not have an NCBI counterpart). Is it normal?  
> **username_4**: Yes. See my answer to your other question. https://bioinformatics.stackexchange.com/a/2474/235  

---

### Answer by username_2 on 2018-01-18. Score: 8

Conversion using R:
library(biomaRt)

mart <- useDataset("hsapiens_gene_ensembl", useMart("ensembl"))

    genes <- getBM(
      filters="ensembl_gene_id",
      attributes=c("ensembl_gene_id", "entrezgene_id"),
      values=ensembl.genes,
      mart=mart)

Where ensembl.genes is a vector of Ensembl gene IDs.

> **Comments:**
> **username_3**: As of 2021-08-05, the attributes argument should be set to `attributes = c("ensembl_gene_id", "entrezgene_id")`. I believe that the `"_id"` appendage has been added to the attribute since this answer was first posted.  

---

