-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrbioapi_uniprot.Rmd
More file actions
298 lines (185 loc) · 9.57 KB
/
rbioapi_uniprot.Rmd
File metadata and controls
298 lines (185 loc) · 9.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
---
title: "2.G: UniProt & rbioapi"
author: "Moosa Rezwani"
description: >
Connect to UniProt in R with rbioapi package.
date: "`r Sys.Date()`"
output:
rmarkdown::html_vignette:
toc: true
anchor_sections: true
number_sections: true
self_contained: true
dev: png
encoding: 'UTF-8'
vignette: >
%\VignetteIndexEntry{2.G: UniProt & rbioapi}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r message=FALSE, include=FALSE, results="hide", setup, echo=FALSE}
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](https://www.uniprot.org "Universal Protein Resource (UniProt)"):
> The Universal Protein Resource (UniProt) is a comprehensive resource for protein sequence and annotation data. The UniProt databases are the [UniProt Knowledgebase (UniProtKB)](https://www.uniprot.org/help/uniprotkb), the [UniProt Reference Clusters (UniRef)](https://www.uniprot.org/help/uniref), and the [UniProt Archive (UniParc)](https://www.uniprot.org/help/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:
```{r rba_uniprot_proteins}
## 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](https://www.uniprot.org/uniprot/P29965 "UniProtKB - P29965 (CD40L_HUMAN)")). 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:
```{r rba_uniprot_proteins_search}
## 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](https://www.uniprot.org/help/advanced_search "UniProtKB advanced search options")' 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:
```{r rba_uniprot_proteins_search1_2}
## 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)
```
```{r rba_uniprot_proteins_search3}
## 3 Search for every proteins with chemokines keyword
multi_prs3 <- rba_uniprot_proteins_search(
keyword = "chemokines"
)
str(multi_prs3, 1)
```
```{r rba_uniprot_proteins_search4}
## 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}
- `rba_uniprot_proteins()`
- `rba_uniprot_proteins_search()`
- `rba_uniprot_proteins_crossref()`
### Features {#proteins-features}
- `rba_uniprot_features()`
- `rba_uniprot_features_search()`
### Variation {#proteins-variation}
`rba_uniprot_variation()`
`rba_uniprot_variation_search()`
### Antigens {#antigens}
- `rba_uniprot_antigens()`
- `rba_uniprot_antigens_search()`
### Epitopes {#epitopes}
- `rba_uniprot_epitope()`
- `rba_uniprot_epitope_search()`
### Mutagenesis {#mutagenesis}
- `rba_uniprot_mutagenesis()`
- `rba_uniprot_mutagenesis_search()`
### RNA-Editing {#rna-editing}
- `rba_uniprot_rna_edit()`
- `rba_uniprot_rna_edit_search()`
## Proteomics {#proteomics}
- `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()`
## Proteomes {#proteomes}
- `rba_uniprot_proteomes()`
- `rba_uniprot_proteomes_search()`
- `rba_uniprot_genecentric()`
- `rba_uniprot_genecentric_search()`
## Taxonomy {#taxonomy}
- `rba_uniprot_taxonomy()`
- `rba_uniprot_taxonomy_lca()`
- `rba_uniprot_taxonomy_lineage()`
- `rba_uniprot_taxonomy_name()`
- `rba_uniprot_taxonomy_path()`
- `rba_uniprot_taxonomy_relationship()`
## Coordinates {#coordinates}
- `rba_uniprot_coordinates()`
- `rba_uniprot_coordinates_search()`
- `rba_uniprot_coordinates_location()`
- `rba_uniprot_coordinates_sequence()`
- `rba_uniprot_genome_coordinates_sequence()`
## UniParc {#uniparc}
- `rba_uniprot_uniparc()`
- `rba_uniprot_uniparc_search()`
- `rba_uniprot_uniparc_bestguess()`
- `rba_uniprot_uniparc_sequence()`
------------------------------------------------------------------------
# How to Cite? {#citations}
To cite UniProt (Please see <https://www.uniprot.org/help/publications>):
- The UniProt Consortium , UniProt: the Universal Protein Knowledgebase in 2025, *Nucleic Acids Research*, 2024;, gkae1010, <https://doi.org/10.1093/nar/gkae1010>
- Andrew Nightingale, Ricardo Antunes, Emanuele Alpi, Borisas Bursteinas, Leonardo Gonzales, Wudong Liu, Jie Luo, Guoying Qi, Edd Turner, Maria Martin, The Proteins API: accessing key integrated protein and genome information, *Nucleic Acids Research*, Volume 45, Issue W1, 3 July 2017, Pages W539--W544, <https://doi.org/10.1093/nar/gkx237>
To cite rbioapi:
- Moosa Rezwani, Ali Akbar Pourfathollah, Farshid Noorbakhsh, rbioapi: user-friendly R interface to biologic web services' API, Bioinformatics, Volume 38, Issue 10, 15 May 2022, Pages 2952--2953, <https://doi.org/10.1093/bioinformatics/btac172>
------------------------------------------------------------------------
# Links {#links}
- [This article in rbioapi documentation site](https://rbioapi.moosa-r.com/articles/rbioapi_uniprot.html "2.F: UniProt & rbioapi")
- [Functions references in rbioapi documentation site](https://rbioapi.moosa-r.com/reference/index.html#section-uniprot-rba-uniprot- "rbioapi reference")
- [rbioapi vignette index](rbioapi.html "rbioapi: User-Friendly R Interface to Biologic Web Services' API")
------------------------------------------------------------------------
# Session info {#session-info}
```{r sessionInfo, echo=FALSE}
sessionInfo()
```