Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ENH: Add histogram plot for significant genes
- Add prefix to plot output
  • Loading branch information
pan14001 committed Feb 7, 2017
1 parent bfc246a commit e5d2dac
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions plots.R
Expand Up @@ -13,8 +13,9 @@ wells_all$type <- relevel(wells_all$type, "RNAi")

theme_set(theme_bw())

plot_save <- function(prefix, extensions = c("png", "pdf", "svg")) {
invisible(sapply(paste(prefix, extensions, sep = "."),
plot_save <- function(prefix, dir = "plots",
extensions = c("png", "pdf", "svg")) {
invisible(sapply(file.path(dir, paste(prefix, extensions, sep = ".")),
ggplot2::ggsave, width = 8, height = 5,
units = "in"))
}
Expand All @@ -23,10 +24,21 @@ ggplot(filter(wells_all, type == "RNAi"),
aes(coloc, fill = significant)) +
geom_histogram(binwidth = binwidth) +
scale_fill_manual(values = c("grey", "blue")) +
ggtitle("Histogram of wells with significant overlap (p-value < 5%)") +
ggtitle("Histogram of RNAi wells with significant overlap (p-value < 5%)") +
xlab("% colocalization")
plot_save("rnai-hist-signif")

ggplot(filter(wells_all,
!is.na(control),
plate == "160415_015529-V"),
aes(coloc, fill = significant)) +
geom_histogram(binwidth = binwidth) +
facet_wrap(~ control) +
scale_fill_manual(values = c("grey", "blue")) +
ggtitle(paste("Histogram of control wells with",
"significant overlap (p-value < 5%)")) +
xlab("% colocalization")

ggplot(wells_all, aes(coloc, color = type)) +
geom_freqpoly(binwidth = binwidth) +
scale_y_log10() +
Expand Down

0 comments on commit e5d2dac

Please sign in to comment.