-
Notifications
You must be signed in to change notification settings - Fork 0
/
geneOncoX.Rmd
392 lines (291 loc) · 9.17 KB
/
geneOncoX.Rmd
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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
---
title: "Getting started"
output:
rmarkdown::html_vignette:
toc: true
vignette: >
%\VignetteIndexEntry{Getting started}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
bibliography: '`r system.file("bibliography.bib", package = "geneOncoX")`'
nocite: |
@Martin2019-nq, @Lever2019-xp, @Repana2019-dd,
@Bailey2018-os, @Sondka2018-wf, @Liu2020-ga,
@Martinez-Jimenez2020-qx, @Wood2001-nk
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
```{r setup, echo = F}
library(geneOncoX)
```
<br><br>
# Installation
**IMPORTANT NOTE**: _geneOncoX_ requires that you have R version 4.1 or higher installed
```{r install, echo = T, eval = F}
if (!("remotes" %in% installed.packages())) {
install.packages("remotes")
}
remotes::install_github('sigven/geneOncoX')
```
<br><br>
# Get basic gene annotations
This shows how to retrieve basic gene and cancer relevant gene annotations,
including how to retrieve tumor suppressor genes, proto-oncogenes, and
predicted cancer driver genes.
```{r basic, echo = T}
library(geneOncoX)
## load the data
download_dir <- tempdir()
gene_basic <- get_basic(cache_dir = download_dir)
## Number of records
nrow(gene_basic$records)
## Show metadata for underlying resources
gene_basic$metadata
```
<br><br>
## Get classified tumor suppressor genes
```{r tsg, echo = T, eval = T, results = "hide"}
## Get tumor suppressor genes - as indicated from either
## Cancer Gene Census (CGC) or Network of Cancer Genes (NCG)
## - show literature support from CancerMine
tsg <- gene_basic$records |>
dplyr::filter(cgc_tsg == TRUE |
ncg_tsg == TRUE) |>
dplyr::select(symbol, entrezgene, name, gene_biotype,
cgc_tsg, ncg_tsg, cancermine_cit_links_tsg,
ncbi_function_summary) |>
dplyr::rename(support_cancermine = cancermine_cit_links_tsg)
## Make as datatable
tsg_table <- DT::datatable(
tsg,
escape = FALSE,
extensions = c("Buttons", "Responsive"),
width = "100%",
options = list(
buttons = c("csv", "excel"), dom = "Bfrtip"))
```
<br>
```{r tsg_dt, echo = F, eval = T}
tsg_table
```
<br><br>
## Get classified proto-oncogenes
```{r oncogene, echo = T, eval = T, results = "hide"}
## Get proto-oncogenes - as indicated from either
## Cancer Gene Census (CGC) or Network of Cancer Genes (NCG),
## - show literature support from CancerMine
oncogene <- gene_basic$records |>
dplyr::filter(cgc_oncogene == TRUE |
ncg_oncogene == TRUE) |>
dplyr::select(symbol, entrezgene,
name, gene_biotype,
cgc_tsg, ncg_tsg,
cancermine_cit_links_oncogene,
ncbi_function_summary) |>
dplyr::rename(support_cancermine =
cancermine_cit_links_oncogene)
## Make as datatable
oncogene_table <- DT::datatable(
oncogene,
escape = FALSE,
extensions = c("Buttons", "Responsive"),
width = "100%",
options = list(
buttons = c("csv", "excel"),
dom = "Bfrtip"))
```
<br>
```{r oncogene_table, echo = F, eval = T}
oncogene_table
```
<br><br>
## Get predicted cancer driver genes
```{r cancer_driver, echo = T, eval = T, results = "hide"}
## Get predicted cancer driver genes - as indicated from either
## - Cancer Gene Census (CGC) - tier1/tier2
## - Network of Cancer Genes (NCG) - canonical drivers
## - IntOGen mutational driver catalogue
## - TCGA's PanCancer driver prediction (Bailey et al., Cell, 2018)
##
## Rank hits by how many sources that contribute to classification
##
cancer_driver <- gene_basic$records |>
dplyr::filter(cgc_driver_tier1 == TRUE |
cgc_driver_tier2 == TRUE |
intogen_driver == TRUE |
ncg_driver == TRUE |
tcga_driver == TRUE) |>
dplyr::mutate(driver_score = 0) |>
dplyr::mutate(driver_score = dplyr::if_else(
cgc_driver_tier1 == T,
driver_score + 2,
as.numeric(driver_score))) |>
dplyr::mutate(driver_score = dplyr::if_else(
cgc_driver_tier2 == T,
driver_score + 1,
as.numeric(driver_score))) |>
dplyr::mutate(driver_score = dplyr::if_else(
intogen_driver == T,
driver_score + 1,
as.numeric(driver_score))) |>
dplyr::mutate(driver_score = dplyr::if_else(
ncg_driver == T,
driver_score + 1,
as.numeric(driver_score))) |>
dplyr::mutate(driver_score = dplyr::if_else(
tcga_driver == T,
driver_score + 1,
as.numeric(driver_score))) |>
dplyr::select(symbol, entrezgene,
name, gene_biotype,
cgc_driver_tier1,
cgc_driver_tier2,
intogen_driver,
#intogen_phenotype,
intogen_role,
ncg_driver,
ncg_phenotype,
tcga_driver,
driver_score,
cancermine_cit_links_driver,
ncbi_function_summary) |>
dplyr::rename(support_cancermine =
cancermine_cit_links_driver) |>
dplyr::arrange(dplyr::desc(driver_score), symbol)
## Make as datatable
driver_table <- DT::datatable(
cancer_driver,
escape = FALSE,
extensions = c("Buttons", "Responsive"),
width = "100%",
options = list(
buttons = c("csv", "excel"),
dom = "Bfrtip"))
```
<br>
```{r driver_table, echo = F, eval = T}
driver_table
```
<br><br>
# Get cancer predisposition genes
This show how to retrieve known cancer predisposition genes, utilizing
multiple sources, including Cancer Gene Census, Genomics England PanelApp,
TCGA's pan-cancer study of germline variants, and other/user-curated entries.
```{r gene_predisposition, echo = T}
## load the data
gene_predisposition <- get_predisposition(cache_dir = download_dir)
## Number of cancer predisposition genes
nrow(gene_predisposition$records |> dplyr::filter(
!stringr::str_detect(cpg_source, "^ACMG_SF$")
))
## Get statistics regarding how reference sources on
## cancer predisposition genes contribute
##
## CGC - Cancer Gene Census (germline)
## PANEL_APP - N = 43 gene panels for inherited cancer conditions/
## cancer syndromes (Genomics England PanelApp)
## CURATED_OTHER - curated/user-contributed genes
## TCGA_PANCAN_2018 - TCGA's pancancer analysis of
## germline variants in cancer
## (Huang et al., Cell, 2019)
## ACMG_SF - Secondary findings list (ACMG, v3.1)
plyr::count(gene_predisposition$records$cpg_source) |>
dplyr::arrange(dplyr::desc(freq)) |>
dplyr::filter(x != "ACMG_SF")
## Cancer predisposition metadata
gene_predisposition$metadata
```
<br><br>
# Get cancer gene panels
This shows how to retrieve genes from cancer gene panels
defined in Genomics England PanelApp.
```{r gene_panels, echo = T}
## load the data
gene_panels <- get_panels(cache_dir = download_dir)
## panel data for genome build grch38
panel_data <- gene_panels$records |>
dplyr::filter(genome_build == "grch38")
## show number of genes in each panel
gene_freq <- as.data.frame(panel_data |>
dplyr::group_by(gepa_panel_name) |>
dplyr::summarise(n = dplyr::n()) |>
dplyr::arrange(desc(n)) |>
dplyr::rename(panel_name = gepa_panel_name))
gene_freq
```
<br><br>
# Get gene aliases
This shows how to retrieve ambiguous and unambiguous gene aliases (i.e. with
respect to primary gene symbols).
```{r gene_alias, echo = T}
## load the data
gene_alias <- get_alias(cache_dir = download_dir)
## number of gene synonyms that are ambiguous
nrow(dplyr::filter(gene_alias$records, ambiguous == TRUE))
## show structure of alias records
head(gene_alias$records)
```
<br><br>
# Get GENCODE transcripts
This shows how to retrieve GENCODE transcripts for `grch37` and `grch38`.
```{r gencode, echo = T}
## load the data
gene_gencode <- get_gencode(cache_dir = download_dir)
## number of transcript records - grch37
nrow(gene_gencode$records$grch37)
## number of transcript records - grch38
nrow(gene_gencode$records$grch38)
## show colnames for transcript records
colnames(gene_gencode$records$grch38)
## show metadata for underlying resources
gene_gencode$metadata
```
<br><br>
# Get DNA repair genes
```{r dna_repair, echo = T}
## load the data
gene_dna_repair <- gene_basic$records |>
dplyr::filter(!is.na(woods_dnarepair_class)) |>
dplyr::select(symbol, woods_dnarepair_class,
woods_dnarepair_activity)
## count number of genes in each class
dna_repair_class_freq <- as.data.frame(
gene_dna_repair |>
dplyr::group_by(woods_dnarepair_class) |>
dplyr::summarise(n = dplyr::n()) |>
dplyr::arrange(desc(n)) |>
dplyr::rename(dna_repair_class = woods_dnarepair_class))
dna_repair_class_freq
```
<br><br>
# Get TSO500 genes
```{r tso500, echo = T}
## load the data
gene_tso500 <- gene_basic$records |>
dplyr::filter(!is.na(illumina_tso500))
## number of genes covered by TSO500 panel
nrow(gene_tso500)
## types of variant types covered
illumina_tso500_variant_freq <- as.data.frame(
gene_tso500 |>
dplyr::group_by(illumina_tso500) |>
dplyr::summarise(n = dplyr::n()) |>
dplyr::arrange(desc(n)))
illumina_tso500_variant_freq
```
<br><br>
# Session Info
\vspace{5pt}
\footnotesize
```{r sessioninfo, eval = TRUE}
# set eval = FALSE if you don't want this info (useful for reproducibility)
# to appear
sessionInfo()
```
\normalsize
<br><br>
# References