title: Entrez gene IDs from gene list using biomaRt
body: <p>I am trying to convert a list of gene names to entrez gene IDs. </p>
  
  <p>for now i have this:</p>
  
  <pre><code>&gt;library(biomaRt)    
  &gt;ensembl &lt;- useMart("ensembl", dataset = "hsapiens_gene_ensembl")
  &gt;mapping &lt;- getBM(attributes=c('ensembl_gene_id','ensembl_transcript_id',
                            'entrezgene', 'hgnc_symbol'),mart = ensembl)
  </code></pre>
  
  <p>This creates a table with the entrez gene IDs and names. However how can I filter out the IDs based on my gene list? </p>
  
  <p>This is an example of the gene names list:
  <a href="https://i.stack.imgur.com/3byvw.png" rel="nofollow noreferrer">Gene names</a></p>
  
  <p>It is just an excel files with couple of hundred gene names in total. </p>
  
  <p>Hopefully someone could help me!</p>