knitr::opts_chunk$set( echo = TRUE, eval = TRUE, message = FALSE, warning = FALSE, collapse = TRUE, tidy = FALSE, cache = FALSE, dev = "png", comment = "#>" ) library(rbioapi) rba_options(timeout = 30, skip_error = TRUE)
Directly quoting from UniProt:
The Universal Protein Resource (UniProt) is a comprehensive resource for protein sequence and annotation data. The UniProt databases are the UniProt Knowledgebase (UniProtKB), the UniProt Reference Clusters (UniRef), and the UniProt Archive (UniParc). The UniProt consortium and host institutions EMBL-EBI, SIB and PIR are committed to the long-term preservation of the UniProt databases.
(source: https://www.uniprot.org/help/about)
Most of rbioapi UniProt functions have two variants. one to retrieve data using a proper accession, and the second one (which have a _search
suffix) is to search using any combination of arguments. We first demonstrate this using an example, then provide a list of such functions in rbioapi.
Suppose we are interested in Human CD40 ligand protein, and we know that it's UniProt accession is "P29965". We can simply do as the following:
## 1 We can retrieve CD40 protein's information by qurying it's UniProt accession: cd40 <- rba_uniprot_proteins(accession = "P29965") ## 2 We use str() to inspect our object's structure str(cd40, 1)
This is the equivalent of the page that UniProt have on this accession (UniProtKB - P29965). But what if we didn't know the UniProt accession? Or simply want to perform a search using certain parameters? We can use the function with _search
suffix:
## 1 From the available arguments, we fill only those which we think is pertinent cd40_search <- rba_uniprot_proteins_search( protein = "CD40 ligand", organism = "human", reviewed = TRUE ) ## 2 As always, we use str() to inspect our object's structure str(cd40_search, 2)
This is the equivalent of 'advanced search' in UniProt web portal. See function rba_uniprot_proteins_search
's manual for more information. Remember that in *_search
functions, you are not required to fill every argument, you can use any combination of arguments you see fit to build your search query.
The applications of *_search
variants are not limited to what the title 'search' implies. These functions will also retrieve the search hits in their response; Thus you can use them for mass-retrieving. If you see the "argument" section in the functions' manuals, you would see that many arguments accept a vector of values. consider the following examples:
## 1 As the simplest scenario, we can retrieve multiple proteins in one call multi_prs1 <- rba_uniprot_proteins_search( accession = c("P04637", "P38398", "P24941", "P60953", "P06493", "Q02241") ) ## As always, we use str() to inspect our object's structure str(multi_prs1, 1) ## 2 Or alternatively, search using Gene names, also we want to exclude isoforms and only retrieve swiss-prot entries multi_prs2 <- rba_uniprot_proteins_search( gene = c("KIF23", "BRCA1", "TP53", "CDC42"), reviewed = TRUE, taxid = 9606, isoform = 0 ) str(multi_prs2, 1)
## 3 Search for every proteins with chemokines keyword multi_prs3 <- rba_uniprot_proteins_search( keyword = "chemokines" ) str(multi_prs3, 1)
## 4 Search for every protein of "SARS-CoV-2" virus in Swiss-Prot multi_prs4 <- rba_uniprot_proteins_search( organism = "SARS-CoV-2", reviewed = TRUE ) str(multi_prs4, 1)
*_search
variant {#functions-with-star-search-variant}The search variants are not limited to the above. Here is a list of the function that have both a retrieve and search variants. See their manuals for detailed guides and examples.
rba_uniprot_proteins()
& rba_uniprot_proteins_search()
rba_uniprot_features()
& rba_uniprot_features_search()
rba_uniprot_variation()
& rba_uniprot_variation_search()
rba_uniprot_proteomics()
& rba_uniprot_proteomics_search()
rba_uniprot_antigens()
& rba_uniprot_antigens_search()
rba_uniprot_epitope()
& rba_uniprot_epitope_search()
rba_uniprot_rna_edit()
& rba_uniprot_rna_edit_search()
rba_uniprot_proteomes()
& rba_uniprot_proteomes_search()
rba_uniprot_ptm()
& rba_uniprot_ptm_search()
rba_uniprot_mutagenesis()
& rba_uniprot_mutagenesis_search()
rba_uniprot_proteomics_hpp()
& rba_uniprot_proteomics_hpp_search()
rba_uniprot_proteomics_non_ptm()
& rba_uniprot_proteomics_non_ptm_search()
rba_uniprot_proteomics_ptm()
& rba_uniprot_proteomics_ptm_search()
rba_uniprot_genecentric()
& rba_uniprot_genecentric_search()
rba_uniprot_uniparc()
& rba_uniprot_uniparc_search()
The UniProt API endpoints are organized into 5 group. Here are those categories and rbioapi functions that correspond to each one. See the functions' manuals for more details.
rba_uniprot_proteins()
rba_uniprot_proteins_search()
rba_uniprot_proteins_crossref()
rba_uniprot_features()
rba_uniprot_features_search()
rba_uniprot_variation()
rba_uniprot_variation_search()
rba_uniprot_antigens()
rba_uniprot_antigens_search()
rba_uniprot_epitope()
rba_uniprot_epitope_search()
rba_uniprot_mutagenesis()
rba_uniprot_mutagenesis_search()
rba_uniprot_rna_edit()
rba_uniprot_rna_edit_search()
rba_uniprot_proteomics_species()
rba_uniprot_proteomics_hpp()
rba_uniprot_proteomics_hpp_search()
rba_uniprot_proteomics_non_ptm()
rba_uniprot_proteomics_non_ptm_search()
rba_uniprot_proteomics_ptm()
rba_uniprot_proteomics_ptm_search()
rba_uniprot_proteomes()
rba_uniprot_proteomes_search()
rba_uniprot_genecentric()
rba_uniprot_genecentric_search()
rba_uniprot_taxonomy()
rba_uniprot_taxonomy_lca()
rba_uniprot_taxonomy_lineage()
rba_uniprot_taxonomy_name()
rba_uniprot_taxonomy_path()
rba_uniprot_taxonomy_relationship()
rba_uniprot_coordinates()
rba_uniprot_coordinates_search()
rba_uniprot_coordinates_location()
rba_uniprot_coordinates_sequence()
rba_uniprot_genome_coordinates_sequence()
rba_uniprot_uniparc()
rba_uniprot_uniparc_search()
rba_uniprot_uniparc_bestguess()
rba_uniprot_uniparc_sequence()
To cite UniProt (Please see https://www.uniprot.org/help/publications):
To cite rbioapi:
sessionInfo()
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.