Answers.Body: <p>You can do this with the <a href="https://github.com/gschofl/reutils" rel="nofollow noreferrer">reutils</a> package, which provides an API to NCBI's <a href="https://www.ncbi.nlm.nih.gov/books/NBK25500/" rel="nofollow noreferrer">E-utilities</a>. Here's an example for your specific question:</p>
  <pre class="lang-r prettyprint-override"><code>install.packages(&quot;reutils&quot;)
  library(reutils)
  
  # Get universal identifier
  uid &lt;- esearch(&quot;NP_000029&quot;, db = &quot;gene&quot;)
  # Fetch summary
  sm &lt;- esummary(uid, db = &quot;gene&quot;)
  # Extract specific tag
  sm$xmlValue(&quot;//Name&quot;)
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-12-04T11:07:42.153Z
Answers.LastActivityDate: 2020-12-04T11:07:42.153Z
Answers.UserDisplayName: Bastian Schiffthaler
Body: <p>I have a protein refseq (eg, NP_000029). How can I get the corresponding gene ID (ag, APC) from NCBI using an R package?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-04T15:32:43.190Z
Comments.Text: Hi @ElizaGanguly Is  efetch not appropriate here?
Comments.UserDisplayName: M__
Tags: <gene><genome><phylogenetics><proteomics><refseq>
Title: Mapping protein refseq to Gene ID
ThreadText: # Mapping protein refseq to Gene ID
  
  (Asked by: username_0 on 2020-12-04)
  
  I have a protein refseq (eg, NP\_000029). How can I get the corresponding gene ID (ag, APC) from NCBI using an R package?
  
  **Tags:** gene, genome, phylogenetics, proteomics, refseq
  
  > **Comments:**
  > **username_1**: Hi @username_0 Is  efetch not appropriate here?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-12-04. Score: 2
  
  You can do this with the [reutils](https://github.com/gschofl/reutils) package, which provides an API to NCBI's [E-utilities](https://www.ncbi.nlm.nih.gov/books/NBK25500/). Here's an example for your specific question:
  
  ```r
  install.packages("reutils")
  library(reutils)
  
  # Get universal identifier
  uid <- esearch("NP_000029", db = "gene")
  # Fetch summary
  sm <- esummary(uid, db = "gene")
  # Extract specific tag
  sm$xmlValue("//Name")
  
  ```
  
  
  ---
  
  