-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rhistory
282 lines (282 loc) · 13.4 KB
/
.Rhistory
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
shiny::runApp('D:/master/CilioGenics-website')
setwd("~/")
library(dplyr)
library(orthoVar)
devtools::install_github("mustafapir/orthoVar")
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("msa")
devtools::install_github("mustafapir/orthoVar")
library(dplyr)
library(orthoVar)
topmed <- read.csv("topmed_analysis.txt", sep="")
zbr <- read.csv("zbr_analysis.txt", sep="")
msa <- read.csv("zebrafish_msa.csv")
msa <- read.csv("zebrafish_msa.csv")
colnames(zbr)[2] = "Refseq_ID"
colnames(topmed)[1] = "Refseq_ID"
ccc = orthoFind(topmed, zbr , "Homo sapiens", "Danio rerio", msa)
View(msa)
head(topmed)
head(zbr)
addonTop = data.frame(Refseq_ID = "ENSP00000411814", position = 1, symbol = "xxx", from = "M", to = "S")
addonZBR = data.frame(Refseq_ID = "ENSDARP00000000005", position = 1, from = "M", to = "S")
zbr = rbind(zbr, addonZBR)
topmed = rbind(topmed, addonTop)
ccc = orthoFind(topmed, zbr , "Homo sapiens", "Danio rerio", msa)
zbr = rbind(zbr, addonZBR)
topmed = rbind(topmed, addonTop)
ccc = orthoFind(topmed, zbr , "Homo sapiens", "Danio rerio", msa)
?orthoFind
colnames(zbr)[1] = "aapos"
colnames(topmed)[2] = "aapos"
ccc = orthoFind(topmed, zbr , "Homo sapiens", "Danio rerio", msa)
head(topmed)
library(data.table)
msa <- fread("zebrafish_msa.csv")
ccc = orthoFind(topmed, zbr , "Homo sapiens", "Danio rerio", msa)
setwd("D:/master/WDR31-ELMOD3-paper/WDR31-ELMOD-RP2")
library(readxl)
library(tidyr)
library(dplyr)
library(patchwork)
library(cowplot)
library(ggplot2)
library(forcats)
ifts<-list()
for (i in 1:4){
iftx<-suppressMessages(read_xlsx("files/IFT_Velocity_IFT_frequency_edited.xlsx", sheet = i))
iftx<-iftx[-1,]
ift_long<-pivot_longer(iftx, everything(), names_to = "Genotype", values_to = "Speed1", values_drop_na = TRUE)
ifty<-suppressMessages(read_xlsx("files/IFT_Velocity_IFT_frequency_edited.xlsx", sheet = i, skip = 1))
ift_long_2<-pivot_longer(ifty, everything(), names_to = "Part", values_to = "Speed", values_drop_na = TRUE)
ift_all<-cbind(ift_long, ift_long_2)
ift_all<-ift_all %>% select(-Speed1)
ift_all[,1:2]<-as.data.frame(lapply(ift_all[,1:2], function(x) gsub("\\.\\.\\.[0-9]+", "", x)))
ifts[[i]]<-ift_all
}
plot1<-list()
for (i in 1:4){
iftplot<-ifts[[i]]
typelist<-unique(iftplot$Part)
genelist<-c("IFT-74::GFP","OSM-6::GFP","OSM-3::GFP","CHE-11::GFP")
iftplot$Part<-as.factor(iftplot$Part)
iftplot$Genotype<-factor(iftplot$Genotype, levels = unique(iftplot$Genotype))
do.call(patchwork::wrap_plots, c(lapply(typelist, function(a) {
ggplot(iftplot[iftplot$Part == a,], aes(x = Genotype, y = Speed, fill = Genotype)) +
geom_boxplot(outlier.shape = NA) +
theme_minimal() +
ylab("IFT Velocity") +
ggtitle(a) +
theme(legend.position = "right", text = element_text(family = "Open Sans SemiBold", size = 12),
plot.title = element_text(hjust = 0.6), axis.text.x=element_blank(), axis.title.x=element_blank())
}), nrow = 1, ncol = 3, guides = "collect")) -> plot
plot<-plot + plot_annotation(title = genelist[i], theme = theme(plot.title = element_text(hjust = 0.5)))
plot1[[i]]<-plot
#print(plot)
}
plot_grid(plotlist = plot1, labels = "AUTO")
plot_grid(plotlist = plot1, labels = "AUTO")
plot1<-list()
for (i in 1:4){
iftplot<-ifts[[i]]
typelist<-unique(iftplot$Part)
genelist<-c("IFT-74::GFP","OSM-6::GFP","OSM-3::GFP","CHE-11::GFP")
iftplot$Part<-as.factor(iftplot$Part)
iftplot$Genotype<-factor(iftplot$Genotype, levels = unique(iftplot$Genotype))
do.call(patchwork::wrap_plots, c(lapply(typelist, function(a) {
ggplot(iftplot[iftplot$Part == a,], aes(x = Genotype, y = Speed, fill = Genotype)) +
geom_boxplot(outlier.shape = NA) +
#scale_fill_manual(values=c("#69b3a2", "grey")) +
scale_fill_brewer(palette="BuPu") +
theme_minimal() +
ylab("IFT Velocity") +
ggtitle(a) +
theme(legend.position = "right", text = element_text(family = "Open Sans SemiBold", size = 12),
plot.title = element_text(hjust = 0.6), axis.text.x=element_blank(), axis.title.x=element_blank())
}), nrow = 1, ncol = 3, guides = "collect")) -> plot
plot<-plot + plot_annotation(title = genelist[i], theme = theme(plot.title = element_text(hjust = 0.5)))
plot1[[i]]<-plot
#print(plot)
}
plot_grid(plotlist = plot1, labels = "AUTO")
plot1<-list()
for (i in 1:4){
iftplot<-ifts[[i]]
typelist<-unique(iftplot$Part)
genelist<-c("IFT-74::GFP","OSM-6::GFP","OSM-3::GFP","CHE-11::GFP")
iftplot$Part<-as.factor(iftplot$Part)
iftplot$Genotype<-factor(iftplot$Genotype, levels = unique(iftplot$Genotype))
do.call(patchwork::wrap_plots, c(lapply(typelist, function(a) {
ggplot(iftplot[iftplot$Part == a,], aes(x = Genotype, y = Speed, fill = Genotype)) +
geom_boxplot(outlier.shape = NA) +
#scale_fill_manual(values=c("#69b3a2", "grey")) +
scale_fill_brewer(palette="Accent") +
theme_minimal() +
ylab("IFT Velocity") +
ggtitle(a) +
theme(legend.position = "right", text = element_text(family = "Open Sans SemiBold", size = 12),
plot.title = element_text(hjust = 0.6), axis.text.x=element_blank(), axis.title.x=element_blank())
}), nrow = 1, ncol = 3, guides = "collect")) -> plot
plot<-plot + plot_annotation(title = genelist[i], theme = theme(plot.title = element_text(hjust = 0.5)))
plot1[[i]]<-plot
#print(plot)
}
plot_grid(plotlist = plot1, labels = "AUTO")
library(orthoVar)
?orthoMSA
tiff("test.tiff", units="in", width = 10, height = 3, res = 300)
plot_grid(plotlist = plot2, labels = "AUTO")
dev.off()
plot2<-list()
typelist2<-unique(iftz_all$Part)
genelist2<-unique(iftz_all$Genotype2)
for (i in 1:length(genelist2)){
iftplot2<-iftz_all[iftz_all$Genotype2 == genelist2[i],]
iftplot2$Genotype<-factor(iftplot2$Genotype, levels = unique(iftplot2$Genotype))
plot<-do.call(patchwork::wrap_plots, c(lapply(typelist2, function(a) {
ggplot(iftplot2[iftplot2$Part == a,], aes(x = Genotype, y = Speed, fill = Genotype)) +
geom_boxplot(outlier.shape = NA) +
#scale_fill_manual(values = c("#69b3a2", "grey")) +
#scale_fill_brewer(palette = "Accent") +
theme_minimal() +
ylab("IFT Frequency") +
ggtitle(a) +
theme(legend.position = "right", text = element_text(family = "Open Sans SemiBold", size = 12),
plot.title = element_text(hjust = 0.6), axis.text.x=element_blank(), axis.title.x=element_blank())
}), nrow = 1, ncol = 3, guides = "collect")) +
plot_annotation(title = genelist2[i], theme = theme(plot.title = element_text(hjust = 0.5)))
plot2[[i]]<-plot
}
iftz<-suppressMessages(read_xlsx("IFT_Velocity_IFT_frequency_edited.xlsx", sheet = 5))
iftz<-iftz %>% select(!grep("number", as.character(as.vector(iftz[2,]))))
iftz<-iftz[c(-1,-2),]
iftz_long<-pivot_longer(iftz, everything(), names_to = "Genotype2", values_to = "Speed1", values_drop_na = TRUE)
iftz2<-suppressMessages(read_xlsx("IFT_Velocity_IFT_frequency_edited.xlsx", sheet = 5, skip = 1))
iftz2<-iftz2 %>% select(!grep("number", as.character(as.vector(iftz2[1,]))))
iftz2<-iftz2[-1,]
iftz_long_2<-pivot_longer(iftz2, everything(), names_to = "Genotype", values_to = "Speed2", values_drop_na = TRUE)
iftz3<-suppressMessages(read_xlsx("IFT_Velocity_IFT_frequency_edited.xlsx", sheet = 5, skip = 2))
iftz3<-iftz3 %>% select(!grep("number", colnames(iftz3)))
iftz_long_3<-pivot_longer(iftz3, everything(), names_to = "Part", values_to = "Speed", values_drop_na = TRUE)
iftz_all<-cbind(iftz_long, iftz_long_2, iftz_long_3)
iftz_all<-iftz_all %>% select(-Speed1, -Speed2)
iftz_all[,1:3]<-as.data.frame(lapply(iftz_all[,1:3], function(x) gsub("\\.\\.\\.[0-9]+", "", x)))
# 2nd plot ----
plot2<-list()
typelist2<-unique(iftz_all$Part)
genelist2<-unique(iftz_all$Genotype2)
for (i in 1:length(genelist2)){
iftplot2<-iftz_all[iftz_all$Genotype2 == genelist2[i],]
iftplot2$Genotype<-factor(iftplot2$Genotype, levels = unique(iftplot2$Genotype))
plot<-do.call(patchwork::wrap_plots, c(lapply(typelist2, function(a) {
ggplot(iftplot2[iftplot2$Part == a,], aes(x = Genotype, y = Speed, fill = Genotype)) +
geom_boxplot(outlier.shape = NA) +
#scale_fill_manual(values = c("#69b3a2", "grey")) +
#scale_fill_brewer(palette = "Accent") +
theme_minimal() +
ylab("IFT Frequency") +
ggtitle(a) +
theme(legend.position = "right", text = element_text(family = "Open Sans SemiBold", size = 12),
plot.title = element_text(hjust = 0.6), axis.text.x=element_blank(), axis.title.x=element_blank())
}), nrow = 1, ncol = 3, guides = "collect")) +
plot_annotation(title = genelist2[i], theme = theme(plot.title = element_text(hjust = 0.5)))
plot2[[i]]<-plot
}
setwd("D:/master/WDR31-ELMOD3-paper/WDR31-ELMOD-RP2/files")
iftz<-suppressMessages(read_xlsx("files/IFT_Velocity_IFT_frequency_edited.xlsx", sheet = 5))
iftz<-iftz %>% select(!grep("number", as.character(as.vector(iftz[2,]))))
iftz<-iftz[c(-1,-2),]
iftz_long<-pivot_longer(iftz, everything(), names_to = "Genotype2", values_to = "Speed1", values_drop_na = TRUE)
iftz2<-suppressMessages(read_xlsx("files/IFT_Velocity_IFT_frequency_edited.xlsx", sheet = 5, skip = 1))
iftz2<-iftz2 %>% select(!grep("number", as.character(as.vector(iftz2[1,]))))
iftz2<-iftz2[-1,]
iftz_long_2<-pivot_longer(iftz2, everything(), names_to = "Genotype", values_to = "Speed2", values_drop_na = TRUE)
iftz3<-suppressMessages(read_xlsx("files/IFT_Velocity_IFT_frequency_edited.xlsx", sheet = 5, skip = 2))
iftz3<-iftz3 %>% select(!grep("number", colnames(iftz3)))
iftz_long_3<-pivot_longer(iftz3, everything(), names_to = "Part", values_to = "Speed", values_drop_na = TRUE)
iftz_all<-cbind(iftz_long, iftz_long_2, iftz_long_3)
iftz_all<-iftz_all %>% select(-Speed1, -Speed2)
iftz_all[,1:3]<-as.data.frame(lapply(iftz_all[,1:3], function(x) gsub("\\.\\.\\.[0-9]+", "", x)))
# 2nd plot ----
plot2<-list()
typelist2<-unique(iftz_all$Part)
genelist2<-unique(iftz_all$Genotype2)
for (i in 1:length(genelist2)){
iftplot2<-iftz_all[iftz_all$Genotype2 == genelist2[i],]
iftplot2$Genotype<-factor(iftplot2$Genotype, levels = unique(iftplot2$Genotype))
plot<-do.call(patchwork::wrap_plots, c(lapply(typelist2, function(a) {
ggplot(iftplot2[iftplot2$Part == a,], aes(x = Genotype, y = Speed, fill = Genotype)) +
geom_boxplot(outlier.shape = NA) +
#scale_fill_manual(values = c("#69b3a2", "grey")) +
#scale_fill_brewer(palette = "Accent") +
theme_minimal() +
ylab("IFT Frequency") +
ggtitle(a) +
theme(legend.position = "right", text = element_text(family = "Open Sans SemiBold", size = 12),
plot.title = element_text(hjust = 0.6), axis.text.x=element_blank(), axis.title.x=element_blank())
}), nrow = 1, ncol = 3, guides = "collect")) +
plot_annotation(title = genelist2[i], theme = theme(plot.title = element_text(hjust = 0.5)))
plot2[[i]]<-plot
}
setwd("D:/master/WDR31-ELMOD3-paper/WDR31-ELMOD-RP2")
iftz<-suppressMessages(read_xlsx("files/IFT_Velocity_IFT_frequency_edited.xlsx", sheet = 5))
iftz<-iftz %>% select(!grep("number", as.character(as.vector(iftz[2,]))))
iftz<-iftz[c(-1,-2),]
iftz_long<-pivot_longer(iftz, everything(), names_to = "Genotype2", values_to = "Speed1", values_drop_na = TRUE)
iftz2<-suppressMessages(read_xlsx("files/IFT_Velocity_IFT_frequency_edited.xlsx", sheet = 5, skip = 1))
iftz2<-iftz2 %>% select(!grep("number", as.character(as.vector(iftz2[1,]))))
iftz2<-iftz2[-1,]
iftz_long_2<-pivot_longer(iftz2, everything(), names_to = "Genotype", values_to = "Speed2", values_drop_na = TRUE)
iftz3<-suppressMessages(read_xlsx("files/IFT_Velocity_IFT_frequency_edited.xlsx", sheet = 5, skip = 2))
iftz3<-iftz3 %>% select(!grep("number", colnames(iftz3)))
iftz_long_3<-pivot_longer(iftz3, everything(), names_to = "Part", values_to = "Speed", values_drop_na = TRUE)
iftz_all<-cbind(iftz_long, iftz_long_2, iftz_long_3)
iftz_all<-iftz_all %>% select(-Speed1, -Speed2)
iftz_all[,1:3]<-as.data.frame(lapply(iftz_all[,1:3], function(x) gsub("\\.\\.\\.[0-9]+", "", x)))
plot2<-list()
typelist2<-unique(iftz_all$Part)
genelist2<-unique(iftz_all$Genotype2)
for (i in 1:length(genelist2)){
iftplot2<-iftz_all[iftz_all$Genotype2 == genelist2[i],]
iftplot2$Genotype<-factor(iftplot2$Genotype, levels = unique(iftplot2$Genotype))
plot<-do.call(patchwork::wrap_plots, c(lapply(typelist2, function(a) {
ggplot(iftplot2[iftplot2$Part == a,], aes(x = Genotype, y = Speed, fill = Genotype)) +
geom_boxplot(outlier.shape = NA) +
#scale_fill_manual(values = c("#69b3a2", "grey")) +
#scale_fill_brewer(palette = "Accent") +
theme_minimal() +
ylab("IFT Frequency") +
ggtitle(a) +
theme(legend.position = "right", text = element_text(family = "Open Sans SemiBold", size = 12),
plot.title = element_text(hjust = 0.6), axis.text.x=element_blank(), axis.title.x=element_blank())
}), nrow = 1, ncol = 3, guides = "collect")) +
plot_annotation(title = genelist2[i], theme = theme(plot.title = element_text(hjust = 0.5)))
plot2[[i]]<-plot
}
tiff("test.tiff", units="in", width = 10, height = 3, res = 300)
plot_grid(plotlist = plot2, labels = "AUTO")
dev.off()
plot_grid(plotlist = plot2, labels = "AUTO")
ggsave("test.tiff", width = 10, height = 3, dpi = 300)
ggsave("test.jpg", width = 10, height = 3, dpi = 300)
ggsave("test.jpg", width = 30, height = 3, dpi = 300)
ggsave("test.jpg", width = 50, height = 20, dpi = 300)
ggsave("test.jpg", width = 30, height = 10, dpi = 300)
tiff("test.tiff", units="in", width = 30, height = 10, res = 300)
plot_grid(plotlist = plot2, labels = "AUTO")
dev.off()
tiff("test.tiff", units="in", width = 30, height = 10, res = 30)
plot_grid(plotlist = plot2, labels = "AUTO")
#ggsave("test.jpg", width = 30, height = 10, dpi = 300)
dev.off()
tiff("test.tiff", units="in", width = 30, height = 10, res = 100)
plot_grid(plotlist = plot2, labels = "AUTO")
#ggsave("test.jpg", width = 30, height = 10, dpi = 300)
dev.off()
tiff("test.jpg", units="in", width = 30, height = 10, res = 300)
plot_grid(plotlist = plot2, labels = "AUTO")
#ggsave("test.jpg", width = 30, height = 10, dpi = 300)
dev.off()
plot_grid(plotlist = plot2, labels = "AUTO")
ggsave("test.jpg", width = 30, height = 10, dpi = 300)