-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathREADME.Rmd
137 lines (88 loc) · 4.03 KB
/
README.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
---
output: github_document
editor_options:
chunk_output_type: inline
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# oncokbR
<!-- badges: start -->
<!-- badges: end -->
{oncokbR} allows you to annotate genomic data sets using MSK's [OncoKB Precision Oncology Knowledge Base](https://www.oncokb.org/) directly in R. The package wraps existing [OncoKB API endpoints](https://api.oncokb.org/oncokb-website/api) so R users can easily leverage the existing API to annotate data on mutations, copy number alterations and fusions.
This package is compatible with oncoKB data v3.16, but is subject to change as new versions are released. For more information on oncoKB, see [Chakravarty et al. 2017](https://ascopubs.org/doi/full/10.1200/PO.17.00011).
{oncokbR} is a part of the [gnomeverse](https://mskcc-epi-bio.github.io/genomeverse/), a collection of R packages designed to work together seamlessly to create reproducible clinico-genomic analysis pipelines.
## Installation
You can install the development version of oncokbR with:
``` r
remotes::install_github('karissawhiting/oncokbR')
```
## Authentication
In order to use this package, you will need to acquire an oncoKB API token and save it to your .Renviron file (or wherever you store credentials). You will need to register for an account on [OncoKB Precision Oncology Knowledge Base](https://www.oncokb.org/). Once your registration is approved, you will see a token under your [Account Settings](https://www.oncokb.org/account/settings). Save it in your .Renviron file as `ONCOKB_TOKEN`. This will save the token as an environmental variable called `ONCOKB_TOKEN` that can be recognized in all package functions.
*Tip: The following {usethis} function can easily find and open the .Renviron for you:*
```{r}
usethis::edit_r_environ()
```
Paste the token you were given (using the format below) in the .Renviron file and save the file changes. After saving you should restart your R session to ensure the token is saved and recognized.
```{r}
ONCOKB_TOKEN = 'YOUR_TOKEN'
```
## Annotate Data
### Annotate Mutations:
```{r}
library(oncokbR)
library(dplyr)
```
Annotate MAF data with tumor type indicated for annotations on oncogenicity and oncoKB treatment levels. This will show the highest sensitivity levels for bladder cancer specifically:
```{r }
blca_mutation <- oncokbR::blca_mutation %>%
mutate(tumor_type = "BLCA")
annotated_tt <- annotate_mutations(mutations = blca_mutation[1:50,])
annotated_tt$oncokb_oncogenic
```
```{r}
annotated_tt %>%
select(oncokb_highest_sensitive_level) %>%
table()
```
You can also annotated with no tumor type data for oncogenicity. Here you'll see the highest sensitive lever is higher than in the bladder specific annotation because it's referring to a non bladder cancer type that has a higher level.
```{r }
blca_mutation <- oncokbR::blca_mutation
annotated_no_tt <- annotate_mutations(mutations = blca_mutation[1:50,])
annotated_no_tt$oncokb_oncogenic
```
```{r }
annotated_no_tt %>%
select(oncokb_highest_sensitive_level) %>%
table()
```
### Annotate CNA:
```{r}
blca_cna <- blca_cna %>%
mutate(tumor_type = "BLCA")
annotated <- annotate_cna(blca_cna[1:10,])
table(annotated$oncokb_oncogenic)
```
### Annotate Structural Variants:
```{r}
blca_sv <- blca_sv %>%
mutate(tumor_type = "BLCA")
annotated <- annotate_sv(blca_sv[1:10,])
table(annotated$oncokb_oncogenic)
```
## Contributing
Please note that {oncokbR} is released with a [Contributor
Code of
Conduct](https://www.karissawhiting.com/oncokbR/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.
Thank you to contributors!
[@david-nemirovsky](https://github.com/david-nemirovsky),
[@patrick120161](https://github.com/patrick120161),
[@edrill](https://github.com/edrill),
[@jalavery](https://github.com/jalavery),
[@stl2137](https://github.com/stl2137)