Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ENH: Plot RNAi replicates
  • Loading branch information
pan14001 committed Feb 14, 2017
1 parent 78482ac commit 2ffbf61
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions plots.R
Expand Up @@ -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))

Expand Down

0 comments on commit 2ffbf61

Please sign in to comment.