diff --git a/03_Figures_Simulations.R b/03_Figures_Simulations.R index 33c62e6e9d18b34037eef07b13b9ec44cc4e80e7..5c19cacfe911fdea43c549db803d0c7627135af6 100644 --- a/03_Figures_Simulations.R +++ b/03_Figures_Simulations.R @@ -247,6 +247,46 @@ ggsave(filename="_pics/FigS4_Extra_CorrInte_08Jul20.png", width=6, height=5, dev +### FIGURE SXXX #### +mypath <- "_data/Experiment_30Oct2020_FactorInteraction&TraitCorr_XW" +myfiles <- list.files(path=mypath, pattern = "Summary.txt", recursive = T) +outp.summary <- FormatData(myfiles) + +mypalette <- palette(c("#e41a1c", #1 - red) + "#ff7f00", #12 - orange + "#984ea3", #13 - violet + "##ffed6f", #2 - yellow + "#4daf4a", #23 - green + "#377eb8")) #3 - blue + +ggplot(data=outp.summary %>% + mutate(main=main/100) %>% + mutate(corr=factor(corr/10, levels=c(0, 0.4, 0.8), labels=paste0("Correlation = ", c(0, 0.4, 0.8)))) %>% + mutate(inter=factor(inter/10, levels=c(0, 0.3, 0.5), labels=paste0("Interaction = ", c(0, 0.3, 0.5)))) %>% + ungroup() %>% + dplyr::filter(stat.type=="XY") %>% + dplyr::filter(trait %in% c("1", "2", "1 2", "3", "1 3", "2 3")) %>% + mutate(trait=factor(trait, levels=c("1", "2", "3", "1 2", "1 3", "2 3"), + labels=c("t1", "t2", "tn", "t1 t2", "t1 tn", "t2 tn")))) + + geom_line(aes(x=main, y=power, group=trait, col=trait)) + + scale_color_manual("Trait\ncomb.", + values=c("#e41a1c", #1 - red) + "#e6ab02", #2 - yellow + "#377eb8", #3 - blue + "#d95f02", #12 - orange + "#984ea3", #13 - violet + "#4daf4a" #23 - green + )) + + facet_grid(corr~inter) + + theme_bw() + + scale_x_continuous(name="Effect of factor e1 -> trait t1") + + scale_y_continuous(name="Prop. of significant tests") + + theme(panel.grid = element_blank()) + +ggsave(filename="_pics/FigSXXX_CorrInte_30November_XW.png", width=6, height=5, device="png", dpi = 300, last_plot()) + + +