2.G: UniProt & rbioapi"

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)

Introduction {#introduction}

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)


Search vs Retrieve {#search-vs-retrieve}

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)

Functions with *_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.

  1. rba_uniprot_proteins() & rba_uniprot_proteins_search()

  2. rba_uniprot_features() & rba_uniprot_features_search()

  3. rba_uniprot_variation() & rba_uniprot_variation_search()

  4. rba_uniprot_proteomics() & rba_uniprot_proteomics_search()

  5. rba_uniprot_antigens() & rba_uniprot_antigens_search()

  6. rba_uniprot_epitope() & rba_uniprot_epitope_search()

  7. rba_uniprot_rna_edit() & rba_uniprot_rna_edit_search()

  8. rba_uniprot_proteomes() & rba_uniprot_proteomes_search()

  9. rba_uniprot_ptm() & rba_uniprot_ptm_search()

  10. rba_uniprot_mutagenesis() & rba_uniprot_mutagenesis_search()

  11. rba_uniprot_proteomics_hpp() & rba_uniprot_proteomics_hpp_search()

  12. rba_uniprot_proteomics_non_ptm() & rba_uniprot_proteomics_non_ptm_search()

  13. rba_uniprot_proteomics_ptm() & rba_uniprot_proteomics_ptm_search()

  14. rba_uniprot_genecentric() & rba_uniprot_genecentric_search()

  15. rba_uniprot_uniparc() & rba_uniprot_uniparc_search()


UniProt functions categories {#uniprot-functions-categories}

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.

Proteins {#proteins}

Proteins: {#proteins-proteins}

Features {#proteins-features}

Variation {#proteins-variation}

rba_uniprot_variation()

rba_uniprot_variation_search()

Antigens {#antigens}

Epitopes {#epitopes}

Mutagenesis {#mutagenesis}

RNA-Editing {#rna-editing}

Proteomics {#proteomics}

Proteomes {#proteomes}

Taxonomy {#taxonomy}

Coordinates {#coordinates}

UniParc {#uniparc}


How to Cite? {#citations}

To cite UniProt (Please see https://www.uniprot.org/help/publications):

To cite rbioapi:


Links {#links}


Session info {#session-info}

sessionInfo()


Try the rbioapi package in your browser

Any scripts or data that you put into this service are public.

rbioapi documentation built on April 4, 2025, 5:04 a.m.