-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fig_S14_Viz.Rmd
217 lines (169 loc) · 11.1 KB
/
Fig_S14_Viz.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
---
title: "Fig_2_Viz"
author: "Troy McDiarmid"
date: "2024-02-13"
output: html_document
---
```{r setup, include=FALSE}
library(tidyverse)
```
```{r}
##Read in data
Pol_III_Pro_Edit_Scores <- read_csv("/Users/troymcdiarmid/Documents/U6_pro_series/Figs/Pub_Figs/FigS14_Final_Figure_Datasets/Pol_III_Pro_Edit_Scores_Class.csv")
##How correlated are edit scores for the same promoter paired with different iBCs after barcode normalization?
BC_1_Edit_Scores <- Pol_III_Pro_Edit_Scores %>%
filter(BC_Number == 1) %>%
distinct(Pro_Seq, .keep_all = TRUE) %>%
select(Seq_Name, Promoter_Class, Pro_Seq, pBC_Seq, BC_1_Edit_Score = Mean_BC_Normalized_Edit_Score_Per_iBC)
BC_2_Edit_Scores <- Pol_III_Pro_Edit_Scores %>%
filter(BC_Number == 2) %>%
distinct(Pro_Seq, .keep_all = TRUE) %>%
select(Pro_Seq, pBC_Seq, BC_2_Edit_Score = Mean_BC_Normalized_Edit_Score_Per_iBC)
BC_3_Edit_Scores <- Pol_III_Pro_Edit_Scores %>%
filter(BC_Number == 3) %>%
distinct(Pro_Seq, .keep_all = TRUE) %>%
select(Pro_Seq, pBC_Seq, BC_3_Edit_Score = Mean_BC_Normalized_Edit_Score_Per_iBC)
Pol_III_Pro_Edit_Scores_By_iBC <- BC_1_Edit_Scores %>%
left_join(BC_2_Edit_Scores, by = "Pro_Seq")
Pol_III_Pro_Edit_Scores_By_iBC <- Pol_III_Pro_Edit_Scores_By_iBC %>%
left_join(BC_3_Edit_Scores, by = "Pro_Seq") %>%
select(Seq_Name, Pro_Seq, Promoter_Class, pBC_Seq_1 = pBC_Seq, pBC_Seq_2 = pBC_Seq.x, pBC_Seq_3 = pBC_Seq.y, BC_1_Edit_Score, BC_2_Edit_Score, BC_3_Edit_Score)
##Setting factors
Human_RNU61_Pol_III_Pro_Edit_Scores_By_iBC <- Pol_III_Pro_Edit_Scores_By_iBC %>%
filter(Promoter_Class == "Human_RNU61p")
U6_Pol_III_Pro_Edit_Scores_By_iBC <- Pol_III_Pro_Edit_Scores_By_iBC %>%
filter(Promoter_Class == "U6")
H1_Pol_III_Pro_Edit_Scores_By_iBC <- Pol_III_Pro_Edit_Scores_By_iBC %>%
filter(Promoter_Class == "H1")
SevenSK_Pol_III_Pro_Edit_Scores_By_iBC <- Pol_III_Pro_Edit_Scores_By_iBC %>%
filter(Promoter_Class == "7SK")
Pol_III_Pro_Edit_Scores_By_iBC <- rbind(U6_Pol_III_Pro_Edit_Scores_By_iBC, SevenSK_Pol_III_Pro_Edit_Scores_By_iBC, H1_Pol_III_Pro_Edit_Scores_By_iBC, Human_RNU61_Pol_III_Pro_Edit_Scores_By_iBC)
Pol_III_Pro_Edit_Scores_By_iBC$Promoter_Class <- factor(Pol_III_Pro_Edit_Scores_By_iBC$Promoter_Class, levels = c("U6", "7SK", "H1", "Human_RNU61p"))
ggplot(Pol_III_Pro_Edit_Scores_By_iBC, aes(x = log2(BC_1_Edit_Score), y = log2(BC_2_Edit_Score), colour = Promoter_Class, size = Promoter_Class, alpha = Promoter_Class)) +
geom_point(stroke = NA) +
scale_color_manual(values=c("#56B4E9", "#56B4E9", "#56B4E9", "black")) +
scale_size_manual(values=c(2,2,2,6)) +
scale_alpha_manual(values=c(0.8,0.8,0.8,1)) +
scale_x_continuous(labels = scales::number_format(accuracy = 0.1), breaks = c(-5,0,5)) +
scale_y_continuous(labels = scales::number_format(accuracy = 0.1), breaks = c(-5,0,5)) +
theme_classic() +
theme(axis.line = element_line(colour = 'black', size = 0.8)) +
theme(axis.ticks = element_line(colour = "black", size = 0.8)) +
theme(axis.ticks.length=unit(.2, "cm")) +
labs(title = "", x = "", y = "") +
theme(legend.position = "none") +
theme(text = element_text(family="Arial", colour = "black", size = 39), plot.margin = margin(0, 15, 0, 20))
ggsave("3k_PolIII_BC1_BC2_Normalized_Corr.jpeg", width = 9, height = 7, path = "/Users/troymcdiarmid/Documents/U6_pro_series/Figs/Pub_Figs/")
ggplot(Pol_III_Pro_Edit_Scores_By_iBC, aes(x = log2(BC_1_Edit_Score), y = log2(BC_3_Edit_Score), colour = Promoter_Class, size = Promoter_Class, alpha = Promoter_Class)) +
geom_point(stroke = NA) +
scale_color_manual(values=c("#56B4E9", "#56B4E9", "#56B4E9", "black")) +
scale_size_manual(values=c(2,2,2,6)) +
scale_alpha_manual(values=c(0.8,0.8,0.8,1)) +
scale_x_continuous(labels = scales::number_format(accuracy = 0.1), breaks = c(-5,0,5)) +
scale_y_continuous(labels = scales::number_format(accuracy = 0.1), breaks = c(-5,0,5)) +
theme_classic() +
theme(axis.line = element_line(colour = 'black', size = 0.8)) +
theme(axis.ticks = element_line(colour = "black", size = 0.8)) +
theme(axis.ticks.length=unit(.2, "cm")) +
labs(title = "", x = "", y = "") +
theme(legend.position = "none") +
theme(text = element_text(family="Arial", colour = "black", size = 39), plot.margin = margin(0, 15, 0, 20))
ggsave("3k_PolIII_BC1_BC3_Normalized_Corr.jpeg", width = 9, height = 7, path = "/Users/troymcdiarmid/Documents/U6_pro_series/Figs/Pub_Figs/")
ggplot(Pol_III_Pro_Edit_Scores_By_iBC, aes(x = log2(BC_2_Edit_Score), y = log2(BC_3_Edit_Score), colour = Promoter_Class, size = Promoter_Class, alpha = Promoter_Class)) +
geom_point(stroke = NA) +
scale_color_manual(values=c("#56B4E9", "#56B4E9", "#56B4E9", "black")) +
scale_size_manual(values=c(2,2,2,6)) +
scale_alpha_manual(values=c(0.8,0.8,0.8,1)) +
scale_x_continuous(labels = scales::number_format(accuracy = 0.1), breaks = c(-5,0,5)) +
scale_y_continuous(labels = scales::number_format(accuracy = 0.1), breaks = c(-5,0,5)) +
theme_classic() +
theme(axis.line = element_line(colour = 'black', size = 0.8)) +
theme(axis.ticks = element_line(colour = "black", size = 0.8)) +
theme(axis.ticks.length=unit(.2, "cm")) +
labs(title = "", x = "", y = "") +
theme(legend.position = "none") +
theme(text = element_text(family="Arial", colour = "black", size = 39), plot.margin = margin(0, 15, 0, 20))
ggsave("3k_PolIII_BC2_BC3_Normalized_Corr.jpeg", width = 9, height = 7, path = "/Users/troymcdiarmid/Documents/U6_pro_series/Figs/Pub_Figs/")
cor.test(Pol_III_Pro_Edit_Scores_By_iBC$BC_1_Edit_Score, Pol_III_Pro_Edit_Scores_By_iBC$BC_2_Edit_Score)
cor.test(Pol_III_Pro_Edit_Scores_By_iBC$BC_1_Edit_Score, Pol_III_Pro_Edit_Scores_By_iBC$BC_3_Edit_Score)
cor.test(Pol_III_Pro_Edit_Scores_By_iBC$BC_2_Edit_Score, Pol_III_Pro_Edit_Scores_By_iBC$BC_3_Edit_Score)
```
```{r}
##How correlated are edit scores for the same promoter paired with different iBCs before barcode normalization?
BC_1_Edit_Scores <- Pol_III_Pro_Edit_Scores %>%
filter(BC_Number == 1) %>%
distinct(Pro_Seq, .keep_all = TRUE) %>%
select(Seq_Name, Promoter_Class, Pro_Seq, pBC_Seq, BC_1_Edit_Score = Mean_Raw_Edit_Score_Per_iBC)
BC_2_Edit_Scores <- Pol_III_Pro_Edit_Scores %>%
filter(BC_Number == 2) %>%
distinct(Pro_Seq, .keep_all = TRUE) %>%
select(Pro_Seq, pBC_Seq, BC_2_Edit_Score = Mean_Raw_Edit_Score_Per_iBC)
BC_3_Edit_Scores <- Pol_III_Pro_Edit_Scores %>%
filter(BC_Number == 3) %>%
distinct(Pro_Seq, .keep_all = TRUE) %>%
select(Pro_Seq, pBC_Seq, BC_3_Edit_Score = Mean_Raw_Edit_Score_Per_iBC)
Pol_III_Pro_Edit_Scores_By_iBC <- BC_1_Edit_Scores %>%
left_join(BC_2_Edit_Scores, by = "Pro_Seq")
Pol_III_Pro_Edit_Scores_By_iBC <- Pol_III_Pro_Edit_Scores_By_iBC %>%
left_join(BC_3_Edit_Scores, by = "Pro_Seq") %>%
select(Seq_Name, Pro_Seq, Promoter_Class, pBC_Seq_1 = pBC_Seq, pBC_Seq_2 = pBC_Seq.x, pBC_Seq_3 = pBC_Seq.y, BC_1_Edit_Score, BC_2_Edit_Score, BC_3_Edit_Score)
##Setting factors
Human_RNU61_Pol_III_Pro_Edit_Scores_By_iBC <- Pol_III_Pro_Edit_Scores_By_iBC %>%
filter(Promoter_Class == "Human_RNU61p")
U6_Pol_III_Pro_Edit_Scores_By_iBC <- Pol_III_Pro_Edit_Scores_By_iBC %>%
filter(Promoter_Class == "U6")
H1_Pol_III_Pro_Edit_Scores_By_iBC <- Pol_III_Pro_Edit_Scores_By_iBC %>%
filter(Promoter_Class == "H1")
SevenSK_Pol_III_Pro_Edit_Scores_By_iBC <- Pol_III_Pro_Edit_Scores_By_iBC %>%
filter(Promoter_Class == "7SK")
Pol_III_Pro_Edit_Scores_By_iBC <- rbind(U6_Pol_III_Pro_Edit_Scores_By_iBC, SevenSK_Pol_III_Pro_Edit_Scores_By_iBC, H1_Pol_III_Pro_Edit_Scores_By_iBC, Human_RNU61_Pol_III_Pro_Edit_Scores_By_iBC)
Pol_III_Pro_Edit_Scores_By_iBC$Promoter_Class <- factor(Pol_III_Pro_Edit_Scores_By_iBC$Promoter_Class, levels = c("U6", "7SK", "H1", "Human_RNU61p"))
ggplot(Pol_III_Pro_Edit_Scores_By_iBC, aes(x = log2(BC_1_Edit_Score), y = log2(BC_2_Edit_Score), colour = Promoter_Class, size = Promoter_Class, alpha = Promoter_Class)) +
geom_point(stroke = NA) +
scale_color_manual(values=c("#56B4E9", "#56B4E9", "#56B4E9", "black")) +
scale_size_manual(values=c(2,2,2,6)) +
scale_alpha_manual(values=c(0.8,0.8,0.8,1)) +
scale_x_continuous(labels = scales::number_format(accuracy = 0.1), breaks = c(-7.5,-2.5,2.5)) +
scale_y_continuous(labels = scales::number_format(accuracy = 0.1), breaks = c(-7.5,-2.5,2.5)) +
theme_classic() +
theme(axis.line = element_line(colour = 'black', size = 0.8)) +
theme(axis.ticks = element_line(colour = "black", size = 0.8)) +
theme(axis.ticks.length=unit(.2, "cm")) +
labs(title = "", x = "", y = "") +
theme(legend.position = "none") +
theme(text = element_text(family="Arial", colour = "black", size = 39), plot.margin = margin(0, 15, 0, 20))
ggsave("3k_PolIII_BC1_BC2_Raw_Corr.jpeg", width = 9, height = 7, path = "/Users/troymcdiarmid/Documents/U6_pro_series/Figs/Pub_Figs/")
ggplot(Pol_III_Pro_Edit_Scores_By_iBC, aes(x = log2(BC_1_Edit_Score), y = log2(BC_3_Edit_Score), colour = Promoter_Class, size = Promoter_Class, alpha = Promoter_Class)) +
geom_point(stroke = NA) +
scale_color_manual(values=c("#56B4E9", "#56B4E9", "#56B4E9", "black")) +
scale_size_manual(values=c(2,2,2,6)) +
scale_alpha_manual(values=c(0.8,0.8,0.8,1)) +
scale_x_continuous(labels = scales::number_format(accuracy = 0.1), breaks = c(-7.5,-2.5,2.5)) +
scale_y_continuous(labels = scales::number_format(accuracy = 0.1), breaks = c(-7.5,-2.5,2.5)) +
theme_classic() +
theme(axis.line = element_line(colour = 'black', size = 0.8)) +
theme(axis.ticks = element_line(colour = "black", size = 0.8)) +
theme(axis.ticks.length=unit(.2, "cm")) +
labs(title = "", x = "", y = "") +
theme(legend.position = "none") +
theme(text = element_text(family="Arial", colour = "black", size = 39), plot.margin = margin(0, 15, 0, 20))
ggsave("3k_PolIII_BC1_BC3_Raw_Corr.jpeg", width = 9, height = 7, path = "/Users/troymcdiarmid/Documents/U6_pro_series/Figs/Pub_Figs/")
ggplot(Pol_III_Pro_Edit_Scores_By_iBC, aes(x = log2(BC_2_Edit_Score), y = log2(BC_3_Edit_Score), colour = Promoter_Class, size = Promoter_Class, alpha = Promoter_Class)) +
geom_point(stroke = NA) +
scale_color_manual(values=c("#56B4E9", "#56B4E9", "#56B4E9", "black")) +
scale_size_manual(values=c(2,2,2,6)) +
scale_alpha_manual(values=c(0.8,0.8,0.8,1)) +
scale_x_continuous(labels = scales::number_format(accuracy = 0.1), breaks = c(-7.5,-2.5,2.5)) +
scale_y_continuous(labels = scales::number_format(accuracy = 0.1), breaks = c(-7.5,-2.5,2.5)) +
theme_classic() +
theme(axis.line = element_line(colour = 'black', size = 0.8)) +
theme(axis.ticks = element_line(colour = "black", size = 0.8)) +
theme(axis.ticks.length=unit(.2, "cm")) +
labs(title = "", x = "", y = "") +
theme(legend.position = "none") +
theme(text = element_text(family="Arial", colour = "black", size = 39), plot.margin = margin(0, 15, 0, 20))
ggsave("3k_PolIII_BC2_BC3_Raw_Corr.jpeg", width = 9, height = 7, path = "/Users/troymcdiarmid/Documents/U6_pro_series/Figs/Pub_Figs/")
cor.test(Pol_III_Pro_Edit_Scores_By_iBC$BC_1_Edit_Score, Pol_III_Pro_Edit_Scores_By_iBC$BC_2_Edit_Score)
cor.test(Pol_III_Pro_Edit_Scores_By_iBC$BC_1_Edit_Score, Pol_III_Pro_Edit_Scores_By_iBC$BC_3_Edit_Score)
cor.test(Pol_III_Pro_Edit_Scores_By_iBC$BC_2_Edit_Score, Pol_III_Pro_Edit_Scores_By_iBC$BC_3_Edit_Score)
```