1
$\begingroup$

I have a protein refseq (eg, NP_000029). How can I get the corresponding gene ID (ag, APC) from NCBI using an R package?

$\endgroup$
1
  • $\begingroup$ Hi @ElizaGanguly Is efetch not appropriate here? $\endgroup$
    – M__
    Dec 4, 2020 at 15:32

1 Answer 1

2
$\begingroup$

You can do this with the reutils package, which provides an API to NCBI's E-utilities. Here's an example for your specific question:

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")
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.