Skip to content
Permalink
e5d2dac199
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
55 lines (47 sloc) 1.75 KB
## See the distribution of % Overlap vs. wells
suppressPackageStartupMessages({
library(ggplot2)
library(dplyr)
})
wells_all <- read.csv("rnai-p_values.csv") %>%
mutate(significant = p_value < 0.05)
binwidth <- 0.025
## Bring RNAi to the front of the level list.
wells_all$type <- relevel(wells_all$type, "RNAi")
theme_set(theme_bw())
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"))
}
ggplot(filter(wells_all, type == "RNAi"),
aes(coloc, fill = significant)) +
geom_histogram(binwidth = binwidth) +
scale_fill_manual(values = c("grey", "blue")) +
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() +
facet_wrap(~ type) +
ggtitle("Histogram of all well types") +
xlab("% colocalization")
plot_save("all-hist")
ggplot(wells_all, aes(coloc, color = type)) +
geom_density() +
facet_wrap(~ type) +
ggtitle("Density plot of wells to show distribution") +
xlab("% colocalization")
plot_save("all-density")