Learn R Programming

bold (version 0.3.0)

bold_seqspec: Get BOLD specimen + sequence data.

Description

Get BOLD specimen + sequence data.

Usage

bold_seqspec(taxon = NULL, ids = NULL, bin = NULL, container = NULL,
  institutions = NULL, researchers = NULL, geo = NULL, marker = NULL,
  response = FALSE, format = "tsv", sepfasta = FALSE, ...)

Arguments

taxon
(character) Returns all records containing matching taxa. Taxa includes the ranks of phylum, class, order, family, subfamily, genus, and species.
ids
(character) Returns all records containing matching IDs. IDs include Sample IDs, Process IDs, Museum IDs and Field IDs.
bin
(character) Returns all records contained in matching BINs. A BIN is defined by a Barcode Index Number URI.
container
(character) Returns all records contained in matching projects or datasets. Containers include project codes and dataset codes
institutions
(character) Returns all records stored in matching institutions. Institutions are the Specimen Storing Site.
researchers
(character) Returns all records containing matching researcher names. Researchers include collectors and specimen identifiers.
geo
(character) Returns all records collected in matching geographic sites. Geographic sites includes countries and province/states.
marker
(character) Returns all records containing matching marker codes.
response
(logical) Note that response is the object that returns from the Curl call, useful for debugging, and getting detailed info on the API call.
format
(character) One of xml or tsv (default). tsv format gives back a data.frame object. xml gives back parsed xml as a
sepfasta
(logical) If TRUE, the fasta data is separated into a list with names matching the processid's from the data frame
...
Further args passed on to httr::GET, main purpose being curl debugging

Value

  • Either a data.frame, parsed xml, a httr response object, or a list with length two (a data.frame w/o nucleotide data, and a list with nucleotide data)

References

http://www.boldsystems.org/index.php/resources/api#combined

Examples

Run this code
bold_seqspec(taxon='Osmia')
bold_seqspec(taxon='Osmia', format='xml')
# bold_seqspec(taxon='Osmia', response=TRUE)
res <- bold_seqspec(taxon='Osmia', sepfasta=TRUE)
res$fasta[1:2]
res$fasta['GBAH0293-06']

## curl debugging
### You can do many things, including get verbose output on the curl call, and set a timeout
library("httr")
head(bold_seqspec(taxon='Osmia', config=verbose()))
# head(bold_seqspec(taxon='Osmia', config=timeout(1)))

Run the code above in your browser using DataLab