Learn R Programming

rentrez (version 1.0.1)

entrez_fetch: Download data from NCBI databases

Description

A set of unique identifiers mush be specified with either the db argument (which directly specifies the IDs as a numeric or character vector) or a web_history object as returned by entrez_link, entrez_search or entrez_post. See Table 1 in the linked reference for the set of formats available for each database.

Usage

entrez_fetch(db, id = NULL, web_history = NULL, rettype, retmode = "",
  parsed = FALSE, config = NULL, ...)

Arguments

db
character, name of the database to use
id
vector (numeric or character), unique ID(s) for records in database db
web_history,
a web_history object
rettype
character, format in which to get data (eg, fasta, xml...)
retmode
character, mode in which to receive data, defaults to 'text'
parsed
boolean should entrez_fetch attempt to parse the resulting file. Only works with xml records (including those with rettypes other than "xml") at present
config
vector, httr configuration options passed to httr::GET
...
character, additional terms to add to the request, see NCBI documentation linked to in references for a complete list

Value

  • character string containing the file created

    XMLInternalDocument a parsed XML document if parsed=TRUE and rettype='xml'

References

http://www.ncbi.nlm.nih.gov/books/NBK25499/#_chapter4_EFetch_

See Also

config for available configs

Examples

Run this code
katipo <- "Latrodectus katipo[Organism]"
katipo_search <- entrez_search(db="nuccore", term=katipo)
kaitpo_seqs <- entrez_fetch(db="nuccore", id=katipo_search$ids, rettype="fasta")

Run the code above in your browser using DataLab