diff --git a/plots.R b/plots.R index c60c826..fa9268f 100644 --- a/plots.R +++ b/plots.R @@ -71,6 +71,28 @@ ggplot(data_wells, aes(symbol, y, color = plate)) + ggtitle("Control colocalization and p-value across plates") plot_save("controls-all_plates", width = 12, height = 8) +symbols_significant <- filter(wells_all, significant == TRUE)$symbol %>% + unique +rnai_replicates <- filter(wells_all, + is.na(control), + symbol %in% symbols_significant) %>% + group_by(symbol) %>% + filter(n() > 1) %>% + mutate(fold_change = coloc / coloc_lacz, + replicates = factor(n())) %>% + gather(key = yaxis, value = y, fold_change, p_value_control) +rnai_fold_change <- rnai_replicates %>% filter(yaxis == "fold_change") +rnai_p_value <- rnai_replicates %>% filter(yaxis == "p_value_control") +ggplot(rnai_replicates, aes(x = symbol, y = y)) + + facet_grid(yaxis ~ ., scale = "free") + + geom_boxplot(data = rnai_fold_change, aes(linetype = replicates)) + + geom_boxplot(data = rnai_p_value, aes(linetype = replicates)) + + geom_jitter(alpha = 0.5, aes(color = plate)) + + scale_color_brewer(palette = "Set1") + + ggtitle("RNAi replicates") + + theme(axis.text.x = element_text(angle = 45, hjust = 1)) +plot_save("rnai-replicates", width = 12, height = 8) + wells_all <- wells_all %>% mutate(control = ifelse(is.na(control), "RNAi", control))