This repository has been archived by the owner on Jun 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Figures.Rmd
115 lines (85 loc) · 3.89 KB
/
Figures.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
---
title: "A Pass at Figures"
author: "Aaron Meyer"
date: "June 28, 2016"
output:
html_document:
keep_md: true
---
```{r setup, include=FALSE, echo=FALSE}
library(dplyr)
library(ggplot2)
MB231 <- read.csv("./data/MB231.csv", stringsAsFactors = FALSE) %>% tidyr::separate(X, into = c("matrix", "drug"), sep = " ")
SKBR3 <- read.csv("./data/SKBR3.csv", stringsAsFactors = FALSE) %>% tidyr::separate(X, into = c("matrix", "drug"), sep = " ")
MB231$matrix <- as.factor(MB231$matrix)
MB231$drug <- as.factor(MB231$drug)
```
**Note that text describes the figure following it.**
## Sample information
### Matrix
- TCPS: tissue culture plastic
- gel: stiff 2D PEG-PC gel
- single: single cells in 3D PEG gel
- sph: spheroids in 3D PEG gel
- serum: spheroids in 3D PEG gel plus serum
### Drugs
- DMSO
- lap: lapatinib
- tems: temsirolimus
- soraf: sorafenib
2 biological replicates, each with 2 technical replicates
DMSO control can be used for all 3 drugs (equalized DMSO concentration across all)
This plots the drug response in each matrix condition separately, against pMek. From this it's possible to see a relationship between viability and pMek that exists across matrix conditions.
```{r mek plot matrix}
ggplot(MB231, aes(x = MEK1, y = prolifTwo, color = drug, shape = matrix)) +
geom_point() + facet_wrap( ~ matrix) +
coord_trans(x = "sqrt", y = "sqrt") + theme_bw() + ylab("Viability (RU)") + xlab("pMek")
```
A linear regression model clearly shows that pMek significantly explains some of the variance in viability. Note that the model explains about 30% of the variance, so there certainly are changes in drug response not completely captured by the model still.
```{r lm model, fig.width=4}
# Scaling the phospho-measurements by z-score
MB231d <- dplyr::select(MB231, prolifTwo, CREB, EGFR, NFkB, p38, AKT, JNK, MEK1, ERK1.2) %>%
scale(center = TRUE, scale = TRUE) %>% data.frame
# Applying the linear model
model <- lm(prolifTwo ~ . + 0, data = MB231d)
# Summarize the model
model.sum <- (summary(model))
# Print the model summary
print(model.sum)
```
Plot of MB231 model parameters.
```{r, fig.width=4}
# Extract the model coefficients for plotting
plotD <- data.frame(model.sum$coefficients)
ggplot(data = plotD, aes(x = Estimate, y = log10(Pr...t..), label = rownames(plotD))) +
geom_point() + theme_bw() + geom_text(nudge_y = 0.06) + scale_y_reverse() + xlim(-1.2, 1.2) +
ylab("Log10 P-Value") + ggtitle("MB231 Viability Linear Model") +
geom_errorbarh(aes(xmin = Estimate - Std..Error, xmax = Estimate + Std..Error))
```
# SKBR3
I've plotted the SKBR3 data with respect to pMek just for consistency with the MB231 data. There are considerable matrix-dependent differences in drug response, but they aren't really explained by pMek.
```{r mek plot matrix skbr}
ggplot(SKBR3, aes(x = MEK1, y = prolifTwo, color = drug, shape = matrix)) + geom_point() + facet_wrap( ~ matrix) +
coord_trans(x = "identity", y = "identity") + theme_bw() + ylab("Viability (RU)") + xlab("pMek")
```
A linear model with the SKBR3 measurements doesn't really pick up much.
```{r, fig.width=4}
# Scaling the phospho-measurements by z-score
SKBR3d <- dplyr::select(SKBR3, prolifTwo, CREB, EGFR, NFkB, p38, AKT, JNK, MEK1, ERK1.2, STAT5, p70s6k) %>%
scale(center = TRUE, scale = TRUE) %>% data.frame
# Applying the linear model
model <- lm(prolifTwo ~ . + 0, data = SKBR3d)
# Summarize the model
model.sum <- (summary(model))
# Print the model summary
print(model.sum)
```
Plot of SKBR3 model parameters.
```{r, fig.width=4}
# Extract the model coefficients for plotting
plotD <- data.frame(model.sum$coefficients)
ggplot(data = plotD, aes(x = Estimate, y = log10(Pr...t..), label = rownames(plotD))) +
geom_point() + theme_bw() + geom_text(nudge_y = 0.03) + scale_y_reverse() +
ylab("Log10 P-Value") + ggtitle("SKBR3 Viability Linear Model") +
geom_errorbarh(aes(xmin = Estimate - Std..Error, xmax = Estimate + Std..Error))
```