get_uniprot_data {queryup} | R Documentation |
Retrieve data from UniProt using UniProt's REST API
Description
Retrieve data from UniProt using UniProt's REST API
Usage
get_uniprot_data(
query = NULL,
base_url = "https://rest.uniprot.org/uniprotkb/",
columns = c("accession", "id", "gene_names", "organism_id", "reviewed")
)
Arguments
query |
list of keys corresponding to UniProt's query fields. For example : list("gene_exact" = c("Pik3r1", "Pik3r2") , "organism" = c("10090", "9606"), "reviewed" = "yes"). See 'query_fields' for available query fields. |
base_url |
The base url for the UniProt REST API |
columns |
names of UniProt data columns to retrieve. Examples include "accession", "id", "gene_names", "keyword", "sequence". See 'return_fields' for available return fields. |
Value
a list with the following items :
- url
the query url
- status
the http status code for the request
- messages
messages returned by the REST API
- content
a data.frame containing the query results
Examples
#Getting gene names, keywords and protein sequences for a set of UniProt IDs.
ids <- c("P22682", "P47941")
cols <- c("accession", "id", "gene_names", "keyword", "sequence")
query = list("accession_id" = ids)
df <- get_uniprot_data(query = query, columns = cols)$content
df
[Package queryup version 1.0.5 Index]