Commit 28ad0ecf authored by Hanna  JULIENNE's avatar Hanna JULIENNE

corrected labels

parent 60f1450f
Pipeline #11602 passed with stages
in 1 minute and 8 seconds
......@@ -16,23 +16,24 @@ for( tag in c("one_causal", "two_causal", "two_opposite"))
performance = read.csv(paste0("./results/amplitude_effect_", tag, ".csv"), header=TRUE)
names(performance) = c("id", "amplitude", "correlation", "MAE", "correlation_large", "MAE_large")
performance = data.table(performance)
head(performance)
perf = performance[, .(mean(correlation), sd(correlation), mean(MAE), sd(MAE),
mean(correlation_large), sd(correlation_large), mean(MAE_large), sd(MAE_large), count=.N), by=amplitude]
names(perf) = c("amplitude", "correlation", "sd_cor","MAE", "sd_mae", "correlation_large", "sd_correlation_large", "MAE_large", "sd_MAE_large","count")
names(causal) =c("SNPid", "Beta")
causal["Zscore"] = Zscore[,2]
c_long = melt(causal, id.var= "SNPid")
p1 = ggplot(c_long[rev(order(c_long[,2])),], aes(x=SNPid, y=value, color=variable)) + geom_line(size=0.6) +geom_point(size=0.5)
p1 = p1 + scale_colour_manual(values=c("orangered", 'royalblue1'))+ theme(legend.position='top',legend.justification="center")
p1 = ggplot(c_long[rev(order(c_long[,2])),], aes(x=SNPid, y=value, color=variable)) + geom_line(size=0.6) + geom_point(size=0.5)
p1 = p1 + scale_colour_manual(values=c("orangered", 'royalblue1')) + theme(legend.position='top', legend.justification="center")
legend_sig = get_legend(p1)
pzscore = ggplot(causal, aes(x=SNPid, y=Zscore)) + geom_line(size=0.6, color="royalblue1") +geom_point(size=0.5, color="royalblue1")
pcause = ggplot(causal, aes(x=SNPid, y=Beta)) + geom_line(size=0.6, color="orangered") +geom_point(size=0.5, color="orangered")
pzscore = ggplot(causal, aes(x=SNPid, y=Zscore)) + geom_line(size=0.6, color="royalblue1") + geom_point(size=0.5, color="royalblue1")
pcause = ggplot(causal, aes(x=SNPid, y=Beta)) + geom_line(size=0.6, color="orangered") + geom_point(size=0.5, color="orangered")
legend_sig = get_legend(p1)
......@@ -53,8 +54,9 @@ for( tag in c("one_causal", "two_causal", "two_opposite"))
p2 =ggplot(perf, aes(x=amplitude, y=correlation)) + geom_point(data=performance, aes(x=amplitude, y=correlation), size=0.1, alpha=0.2) + geom_line(color="royalblue1",size=1) + geom_errorbar(aes(ymin=correlation-sd_cor/(count^0.5), ymax=correlation+sd_cor/(count^0.5)),color="royalblue1", position=position_dodge(0.05))
p2 = p2 + ylab("")
p2 = p2 + ylab("") + xlab("SNP effect size at spike")
p2
if(tag != "one_causal")
{
plot_list[[paste0(tag,"_perf")]] = p2 + ylim(0,1) + ylab("")
......@@ -80,7 +82,7 @@ for( tag in c("one_causal", "two_causal", "two_opposite"))
}
upper_panel = plot_grid(plot_list[[1]],plot_list[[4]],plot_list[[7]],
plot_list[[2]],plot_list[[5]],plot_list[[8]],
plot_list[[2]],plot_list[[5]],plot_list[[8]], labels=c("A", "","", "B","",""),label_size=18,
align="h", nrow=2)
upper_panel_with_leg = plot_grid(legend_sig, upper_panel, rel_heights=c(0.06, 0.94), nrow=2)
......@@ -91,14 +93,13 @@ lower_panel = plot_grid(plot_list[[3]],
tiff(filename = "Supp_fig_causal2.tiff",
width = 900, height = 900, units = "px", pointsize = 12)
plot_grid(upper_panel_with_leg, lower_panel, rel_heights=c(0.65,0.35), labels=c("A", "B"), label_size=18, nrow=2)
plot_grid(upper_panel_with_leg, lower_panel, rel_heights=c(0.65,0.35), labels=c("", "C"), label_size=18, nrow=2)
dev.off()
panel_MAE = plot_list_for_reviewer[[tag]]
panel_neuneu = plot_grid(plot_list_for_reviewer[[1]] + ylab("MAE"),plot_list_for_reviewer[[4]],plot_list_for_reviewer[[7]],
plot_list_for_reviewer[[2]] + ylab("Correlation_on_large"),plot_list_for_reviewer[[5]],plot_list_for_reviewer[[8]],
plot_list_for_reviewer[[3]]+ ylab("MAE_on_large"),plot_list_for_reviewer[[6]],plot_list_for_reviewer[[9]],
plot_list_for_reviewer[[3]] + ylab("MAE_on_large"),plot_list_for_reviewer[[6]],plot_list_for_reviewer[[9]],
align="h", nrow=3)
tiff(filename = "for_reviewer_info.tiff",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment