Description description Author(s) Examples
The Rentrez package provides an interface to NCBI's Entrez utilities.
NCBI provides the EUtilities web service for software to query the Entrez databases directly, rather than through the web interface. For more information see here.
This package provides an interface to construct query URLs and parse query results.
The main Entrez web page is available at http://www.ncbi.nlm.nih.gov/Entrez/and a list of the Entrez utilities can be found at http://www.ncbi.nlm.nih.gov/entrez/utils/utils_index.html.
Important functions:
esearch
: Searches and retrieves primary UIDs for use
in epost
, esummary
, elink
, or efetch
.
esearch
additonally returns term translations and optionally
stores results for future use in the user's Web Environment.
esummary
: Retrieves document summaries from
a list of primary UIDs (Provided as a character vector or as an
esearch
instance).
efetch
: Retrieves data records in a specified
format corresponding to a list of primary UIDs or from the user's Web
Environment.
elink
: Returns a list of UIDs (and relevancy
scores) from a target database that are related to a list of UIDs in
the same database or in another Entrez database.
einfo
: Provides field names, term counts, last
update, and available updates for each database.
epost
: Uploads primary UIDs to the users's Web
Environment on the Entrez history server for subsequent use with
esummary
, elink
, or efetch
.
content
: Extract the content of a request from the
eutil
object returned by any of the above functions.
Typical usage is:
require(Rentrez) pub <- efetch(id=c("19304878","14630660"), db="pubmed") records <- content(pub)
Gerhard Sch<c3><b6>fl gschofl@yahoo.de
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | #
# combine esearch with efetch
#
# Download PubMed records that are indexed in MeSH for both 'Clamydia' and
# 'genome' and were published in 2012.
#
query <- "Chlamydia[mesh] and genome[mesh] and 2012[pdat]"
#
# check how many records fit the bill and download the PMIDs
#
n <- esearch(query, "pubmed", rettype="count")
n
pmids <- esearch(query, "pubmed", retmax=count(n))
#
# Fetch the records and retrieve the XML response
#
articles <- efetch(pmids)
articles_xml <- content(articles)
articles_xml
############################################################################
#
# combine epost with esummary/efetch
#
# Download protein records corresponding to a list of GI numbers.
#
id <- c(194680922,50978626,28558982,9507199,6678417)
#
# post the GI numbers to the Entrez history server
#
p <- epost(id, "protein")
#
# retrieve docsums with esummary
#
sum <- docsum(esummary(p))
#
# get FASTAs with efetch
#
prot <- efetch(p, retmode="text", rettype="fasta")
#
# retrieve the content of the efetch object
#
seq <- content(prot)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.