Get a single entry from UniProt.
By default it fetches the webpage using format = "json"
and outputs a
list of information, but different formats are available from different
databases. It is a wrapper for
this UniProt API
endpoint.
Usage
uniprot_single(
id,
database = "uniprotkb",
format = "json",
path = NULL,
fields = NULL,
isoform = NULL,
verbosity = NULL,
dry_run = FALSE
)
Arguments
- id
string
, entry ID. Form depends on database e.g."P12345"
for UniProtKB,"UPI0000128BBF"
for UniParc, etc.- database
string
, database to look up. Default is"uniprotkb"
. See the Databases section below for all available databases.- format
string
, data format to fetch. Default is"json"
. Can be one of"tsv"
,"json"
, or"fasta"
.- path
string
(optional), file path to save the results, e.g."path/to/results.tsv"
.- fields
character
(optional), fields (i.e. columns) of data to get. The fields available depends on the database used, see return_fields for all available fields.- isoform
logical
(optional), should protein isoforms be included in the results? Not necessarily relevant for all formats and databases.- verbosity
integer
(optional), how much information to print?0: no output
NULL (default): minimal output
1: show request headers
2: show request headers and bodies
3: show request headers, bodies, and curl status messages
- dry_run
logical
, perform request withhttr2::req_dry_run()
? Requires thehttpuv
package to be installed. Default isFALSE
.
Value
By default, returns an object whose type depends on format
:
tsv
:data.frame
json
:list
fasta
: Biostrings::AAStringSet (ornamed character
if Biostrings not installed)
If path
is specified, saves the results to the file path indicated,
and returns NULL
invisibly. If dry_run = TRUE
, returns a
list containing information about the request, including the request
method
, path
, and headers
.
Databases
The following databases are available to query:
uniprotkb
: UniProt Knowledge Baseuniref
: UniProt Reference Clustersuniparc
: UniProt Archiveproteomes
: Reference proteomestaxonomy
: Taxonomykeywords
: Keywordscitations
: Literature referencesdiseases
: Disease queriesdatabase
: Cross referenceslocations
: Subcellular locationunirule
: UniRulearba
: ARBA (Association-Rule-Based Annotator)
See also
Other API wrapper functions: uniprot_map()
, uniprot_search()
Examples
if (FALSE) {
# Download the entry for human Cytochrome C
res <- uniprot_single("P99999", format = "json")
# Look at the structure of the resulting list
str(res, max.level = 1)
}