source('/Volumes/jjeliazkov/xtal_design/Mizutani_forward_design/analysis/plot_designs_w_comparison.R')
source('/Volumes/jjeliazkov/xtal_design/Mizutani_forward_design/analysis/plot_designs_w_comparison.R')
source('/Volumes/jjeliazkov/xtal_design/Mizutani_forward_design/analysis/plot_designs_w_comparison.R')
234*5
View(mutations)
View(mutations)
ddply(mutations, .(resi, set), mutate, dWT = avg_E-avg_E[label=="WT"])
View(mutations)
ddply(mutations, .(resi, set), mutate, dWT = avg_E-avg_E[label=="WT"])
str(mutations)
ddply(mutations, .(resi, set), summarize, t = mean(avg_E))
ddply(mutations, .(resi, set), transform, t = avg_E - avg_E[label=="WT"] )
mutations[label=="WT",]
mutations[mutations$label=="WT",]
ddply(mutations, .(set, resi), transform, t = avg_E - avg_E[label=="WT"] )
ddply(mutations, .(set, resi), transform, avg_E = avg_E - avg_E[label=="WT"] )
ddply(mutations, .(set, resi), mutate, avg_E = avg_E - avg_E[label=="WT"] )
ddply(mutations, .(set, resi), transform, avg_E = avg_E - avg_E[label=="WT"] )
ddply(mutations, .(set, resi), transform, dWT = avg_E - avg_E[label=="WT"] )
ddply(mutations, .(set, resi), mutate, dWT = avg_E - avg_E[label=="WT"] )
View(repack_sc_jump)
View(mutations)
str(mutations)
source('/Volumes/jjeliazkov/xtal_design/Mizutani_forward_design/analysis/plot_designs_w_comparison.R')
ggplot(m, aes(x=resolution, y=dWT)) + geom_point() + facet_wrap(~set,nrow=2) + geom_hline(yintercept = 0, linetype="dashed") + geom_vline(xintercept = 2.1, linetype="dashed") + theme_minimal()
ggplot(m, aes(x=resolution, y=dWT)) + geom_point() + facet_wrap(~set,nrow=2) + geom_hline(yintercept = 0, linetype="dashed") + geom_vline(xintercept = 2.1, linetype="dashed")
ggplt(mizutani.results, aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_grid(resi~set)
ggplot(mizutani.results, aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_grid(resi~set)
ggplot(mutations, aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_grid(resi~set)
ggplot(mutations, aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_grid(resi~set) + ylim(15,-15)
ggplot(mutations, aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_grid(resi~set) + ylim(-15,15)
ggplot(mutations, aes(x=aa_id, y=dWT, fill=dWT<0)) + geom_bar(stat="identity") + facet_grid(resi~set) + ylim(-15,15)
ggplot(mutations, aes(x=aa_id, y=dWT, fill=dWT<0)) + geom_bar(stat="identity") + facet_grid(resi~set) + ylim(-30,30)
ggplot(subset(mutations,dWT<0), aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_grid(resi~set)
ggplot(subset(mutations,dWT<0), aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_grid(resi~set) + theme_bw()
ggplot(subset(mutations,dWT<0), aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_grid(resi~set) + theme_minimal()
ggplot(subset(mutations,dWT<0), aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_wrap(resi~set) + theme_minimal()
ggplot(subset(mutations,dWT<0,fill=set), aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_wrap(resi~set) + theme_minimal()
ggplot(subset(mutations,dWT<0), aes(x=aa_id, y=dWT,fill=set)) + geom_bar(stat="identity") + facet_wrap(resi~set) + theme_minimal()
ggplot(subset(mutations,dWT<0), aes(x=aa_id, y=dWT,fill=set)) + geom_bar(stat="identity") + facet_wrap(resi~set) + theme_minimal() + guides(fill=F)
ggplot(subset(mutations,dWT<0), aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_grid(resi~set) + theme_minimal()
source('/Volumes/jjeliazkov/xtal_design/Mizutani_forward_design_no_input_sc/analysis/plot_designs_w_comparison.R')
source('/Volumes/jjeliazkov/xtal_design/Mizutani_forward_design_no_input_sc/analysis/plot_designs_w_comparison.R')
ggplot(subset(mutations,dWT<0), aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_grid(resi~set) + theme_minimal()
source('/Volumes/jjeliazkov/xtal_design/Mizutani_forward_design_no_input_sc/analysis/plot_designs_w_comparison.R')
ggplot(subset(mutations,dWT<0), aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_grid(resi~set) + theme_minimal()
ggplot(subset(mutations,dWT<0 & set != "repack_min_sc"), aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_grid(resi~set) + theme_minimal()
ggplot(subset(mutations,dWT<0), aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_grid(resi~set) + theme_minimal() + ylim(0,-15)
ggplot(subset(mutations,dWT<0), aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_grid(resi~set) + theme_minimal() + ylim(-15,0)
ggplot(m, aes(x=resolution, y=dWT)) + geom_point() + facet_wrap(~set,nrow=2) + geom_hline(yintercept = 0, linetype="dashed") + geom_vline(xintercept = 2.1, linetype="dashed") + theme_minimal()
source('/Volumes/jjeliazkov/xtal_design/Mizutani_forward_design/analysis/plot_designs_w_comparison.R')
ggplot(m, aes(x=resolution, y=dWT)) + geom_point() + facet_wrap(~set,nrow=2) + geom_hline(yintercept = 0, linetype="dashed") + geom_vline(xintercept = 2.1, linetype="dashed") + theme_minimal()
source('/Volumes/jjeliazkov/xtal_design/Mizutani_forward_design/analysis/plot_designs_w_comparison.R')
str(repack_sc_bb_jump)
ggplot(subset(mutations,set=="repack_min_sc_bb_jump"), aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_wrap(~resi) + theme_minimal()
ggplot(subset(mutations,set=="repack_min_sc_bb_jump"), aes(x=aa_id, y=dWT, fill=dWT<0)) + geom_bar(stat="identity") + facet_wrap(~resi) + theme_minimal()
ggplot(subset(mutations,set=="repack_min_sc_bb_jump"), aes(x=aa_id, y=dWT, fill=dWT<0)) + geom_bar(stat="identity") + geom_errorbar(ymax=dWT+sd_E,ymin=dWT-sdE) + facet_wrap(~resi) + theme_minimal()
ggplot(subset(mutations,set=="repack_min_sc_bb_jump"), aes(x=aa_id, y=dWT, fill=dWT<0)) + geom_bar(stat="identity") + geom_errorbar(ymax=dWT+sd_E,ymin=dWT-sd_E) + facet_wrap(~resi) + theme_minimal()
ggplot(subset(mutations,set=="repack_min_sc_bb_jump"), aes(x=aa_id, y=dWT, fill=dWT<0)) + geom_bar(stat="identity") + geom_errorbar(aes(ymax=dWT+sd_E,ymin=dWT-sd_E)) + facet_wrap(~resi) + theme_minimal()
ggplot(subset(mutations,set=="repack_min_sc_bb_jump"), aes(x=aa_id, y=dWT, color=dWT<0)) + geom_point() + geom_errorbar(aes(ymax=dWT+sd_E,ymin=dWT-sd_E)) + facet_wrap(~resi) + theme_minimal()
ggplot(subset(mutations,set=="repack_min_sc_bb_jump"), aes(x=aa_id, y=dWT, color=dWT<0)) + geom_point() + geom_errorbar(aes(ymax=dWT+sd_E,ymin=dWT-sd_E)) + facet_wrap(~resi) + theme_minimal() + geom_hline(yintercept = 0, linetype="dashed")
ggplot(subset(mutations,set=="repack_min_sc_bb_jump"), aes(x=aa_id, y=dWT, color=dWT<0)) + geom_point() + geom_errorbar(aes(ymax=dWT+sd_E,ymin=dWT-sd_E)) + facet_wrap(~resi) + theme_bw() + geom_hline(yintercept = 0, linetype="dashed")
ggplot(subset(mutations,set=="repack_min_sc_bb_jump"), aes(x=aa_id, y=dWT, color=dWT<0)) + geom_point() + geom_errorbar(aes(ymax=dWT+sd_E,ymin=dWT-sd_E)) + facet_wrap(~resi, scales="free") + theme_bw() + geom_hline(yintercept = 0, linetype="dashed")
ggplot(subset(m, set=="repack_min_sc_bb_jump"), aes(x=resolution, y=dWT)) + geom_point() + facet_wrap(~set,nrow=2) + geom_hline(yintercept = 0, linetype="dashed") + geom_vline(xintercept = 2.1, linetype="dashed") + theme_minimal() + geom_errorbar(aes(ymax=dWT+sd_E,ymin=dWT-sd_E))
ggplot(subset(mutations,set=="repack_min_sc_bb_jump"), aes(x=aa_id, y=dWT, color=dWT<0)) + geom_point() + geom_errorbar(aes(ymax=dWT+sd_E,ymin=dWT-sd_E)) + facet_wrap(~resi, scales="free") + theme_bw() + geom_hline(yintercept = 0, linetype="dashed")
ggplot(mutations, aes(x=aa_id, y=dWT, color=dWT<0)) + geom_point() + geom_errorbar(aes(ymax=dWT+sd_E,ymin=dWT-sd_E)) + facet_grip(set~resi) + theme_bw() + geom_hline(yintercept = 0, linetype="dashed")
ggplot(mutations, aes(x=aa_id, y=dWT, color=dWT<0)) + geom_point() + geom_errorbar(aes(ymax=dWT+sd_E,ymin=dWT-sd_E)) + facet_grid(set~resi) + theme_bw() + geom_hline(yintercept = 0, linetype="dashed")
ggplot(mutations, aes(x=aa_id, y=dWT, color=dWT<0)) + geom_point() + geom_errorbar(aes(ymax=dWT+sd_E,ymin=dWT-sd_E)) + facet_grid(set~resi) + theme_bw() + geom_hline(yintercept = 0, linetype="dashed") + ylim(-15,15)
ggplot(mutations, aes(x=aa_id, y=dWT, color=dWT<0)) + geom_point() + geom_errorbar(aes(ymax=dWT+sd_E,ymin=dWT-sd_E)) + facet_grid(resi~set) + theme_bw() + geom_hline(yintercept = 0, linetype="dashed") + ylim(-15,15)
source('/Volumes/jjeliazkov/xtal_design/Mizutani_forward_design/analysis/plot_designs_w_comparison.R')
ggplot(subset(mutations,set=="repack_min_sc_bb_jump"), aes(x=aa_id, y=dWT_min, color=dWT_min<0)) + geom_point() + facet_wrap(~resi, scales="free") + theme_bw() + geom_hline(yintercept = 0, linetype="dashed")
ggplot(mutations, aes(x=aa_id, y=dWT_min, color=dWT_min<0)) + geom_point() + facet_wrap(resi~set, scales="free") + theme_bw() + geom_hline(yintercept = 0, linetype="dashed")
ggplot(mutations, aes(x=aa_id, y=dWT_min, color=dWT_min<0)) + geom_point() + facet_wrap(set~resi, scales="free", nrow=13) + theme_bw() + geom_hline(yintercept = 0, linetype="dashed")
ggplot(mutations, aes(x=aa_id, y=dWT_min, color=dWT_min<0)) + geom_point() + facet_wrap(set~resi, scales="free", ncol=13) + theme_bw() + geom_hline(yintercept = 0, linetype="dashed")
source('/Volumes/jjeliazkov/xtal_design/Mizutani_forward_design_no_input_sc/analysis/plot_designs_w_comparison.R')
source('/Volumes/jjeliazkov/xtal_design/Mizutani_forward_design_no_input_sc/analysis/plot_designs_w_comparison.R')
ggplot(mutations, aes(x=aa_id, y=dWT_min, color=dWT_min<0)) + geom_point() + facet_wrap(set~resi, scales="free", ncol=13) + theme_bw() + geom_hline(yintercept = 0, linetype="dashed")
?substr
?strsplit()
strsplit("1WNG.relax_0005", "_")
strsplit("1WNG.relax_0005", "_")
strsplit("1WNG.relax_0005", "_")[1]
strsplit("1WNG.relax_0005", "_")[[1]]
unlist(strsplit("1WNG.relax_0005", "_"))
unlist(strsplit(c("1WNG.relax_0004","1WNG.relax_0005"), "_"))
strsplit(c("1WNG.relax_0004","1WNG.relax_0005"), "_")
strsplit(c("1WNG.relax_0004","1WNG.relax_0005"), "_")[1]
strsplit(c("1WNG.relax_0004","1WNG.relax_0005"), "_")[1,2]
strsplit(c("1WNG.relax_0004","1WNG.relax_0005"), "_")[1][1]
strsplit(c("1WNG.relax_0004","1WNG.relax_0005"), "_")[1][[1]]
strsplit(c("1WNG.relax_0004","1WNG.relax_0005"), "_")[1]
strsplit(c("1WNG.relax_0004","1WNG.relax_0005"), "_")[[1]]
strsplit(c("1WNG.relax_0004","1WNG.relax_0005"), "_")[[1]][1]
strsplit(c("1WNG.relax_0004","1WNG.relax_0005"), "_")[[1]][2]
strsplit(c("1WNG.relax_0004","1WNG.relax_0005"), "_")[[:]][2]
library(stringr)
str_split_fixed("1WNG.relax_0004", "_", 2)
str_split_fixed("1WNG.relax_0004", "_", 1)
str_split_fixed("1WNG.relax_0004", "_", 3)
str_split_fixed("1WNG.relax_0004", "_", 2)
?str_split
str_split("1WNG.relax_0004", "_", 2)
?grep
grep("_[0-9]*", invert=T)
grep("_[0-9]*", "1WNG.relax_0004", invert=T)
grep("_[0-9]*", "1WNG.relax_0004")
grep("\_[0-9]*", "1WNG.relax_0004")
grep("_[0-9]*", "1WNG.relax_0004")
grep("_[0-9]*", "1WNG.relax_0004", value=T)
sub("_[0-9]*", "\\1", "1WNG.relax_0004")
?sub
gsub("([ab])", "\\1_\\1_", "abc and ABC")
sub("_[0-9]*", "\\1", c("1WNG.relax_0004","1WNG.relax_0004"))
source('/Volumes/jjeliazkov/xtal_design/Mizutani_forward_design/analysis/plot_designs_w_comparison.R')
ggplot(m, aes(x=resolution, y=dWT_avg, label=paste0(resi,aa_id), fill=(resolution<2.1 & dWT_avg<0))) + geom_label() + facet_wrap(~set,nrow=2) + geom_hline(yintercept = 0, linetype="dashed") + geom_vline(xintercept = 2.1, linetype="dashed") + theme_bw() + guides(fill=F)
#ggplot(subset(mutations,dWT<0), aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_grid(resi~set) + theme_minimal()
ggplot(subset(mutations,dWT<0), aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_grid(resi~set) + theme_minimal()
ggplot(subset(mutations,dWT_avg<0), aes(x=aa_id, y=dWT)) + geom_bar(stat="identity") + facet_grid(resi~set) + theme_minimal()
ggplot(subset(mutations,dWT_avg<0), aes(x=aa_id, y=dWT_avg)) + geom_bar(stat="identity") + facet_grid(resi~set) + theme_minimal()
