forked from ablucher/Workshop_ReproduciblePaper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Binder_SetUpExample.Rmd
77 lines (58 loc) · 1.96 KB
/
Binder_SetUpExample.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
---
title: "Workshop- Binder Demo"
author: "Aurora S Blucher"
date: "12/23/2019"
output: html_notebook
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(dplyr)
library(ggplot2)
library(here)
```
## Demo: Creating a barplot of drug-target interactions
Quick example for workshop on binder. We read in some data (drug-target interactions), select a drug of interest (Vandetanib), and make a bar plot so we can see targets that have been found to interact with this drug at a low IC50 value.
Binder set up through mybinder.org, using docker file set up within the repository. See README for more information.
```{r}
#read in our data file
#which contains drug-target relationships, specified by the assay value (such as an IC50) describing the strength between the drug and target
fullDrugTargetFile<-read.table(here("data", "Targetome_Evidence_TIPS_101017.txt"), header = TRUE, sep="\t")
head(fullDrugTargetFile)
```
```{r}
#let's see what drugs we have
drugNames<-fullDrugTargetFile %>%
select(Drug) %>%
distinct() %>%
arrange(Drug)
#137 total drugs here
drugNames
```
```{r}
#say we are interested in 1 drug -> vandetanib
#let's pull all the targets and take al ook
vandetanibTargets<-fullDrugTargetFile %>%
filter(Drug=="Vandetanib")
head(vandetanibTargets)
```
```{r}
#low IC50 means stronger target relationships
#let's filter to all the targets that had a reported IC50<=100
vandetanib_under100M<-vandetanibTargets %>%
filter(Assay_Type=="IC50" & Assay_Relation=="=" & Assay_Value<=100) %>%
arrange(Target_Name, Assay_Value) %>%
distinct()
vandetanib_under100M
```
```{r}
#make a quick barplot, no frills
#show the different targets for this drug
#fill color by target so we can get a nice overview
barPlot<-vandetanib_under100M %>%
group_by(Drug, Target_Name) %>%
ggplot(aes(x=Assay_Value, fill=Target_Name), color="black") +
geom_bar(width=1)
barPlot
#save our figure
ggsave(here("output", "MyFavorite_BarPlot.png"), barPlot)
```