Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MAINT: Use new directory layout
  • Loading branch information
pan14001 committed Mar 22, 2017
1 parent 7245824 commit eb9cab8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions src/overlap-analysis.R
Expand Up @@ -7,8 +7,8 @@ suppressPackageStartupMessages({
})

## Configuration values.
file_db <- "cellprofiler_all-plates/all-plates.db"
files_plate <- "plates/DRSC_TF_Library_Distribution.xls"
file_db <- file.path("../results/cellprofiler/rnai-screen-tf.db")
files_plate <- "../data/DRSC_TF_Library_Distribution.xls"

## Plate 504 was run at the last minute, and so the controls are not
## reflected in the Excel spreadsheet provided by the core facility.
Expand Down Expand Up @@ -141,4 +141,5 @@ wells_repeated <- group_by(wells_all, symbol) %>%
filter(n > 1)
print(summary(wells_repeated))

write_csv(wells_all %>% arrange(p_value), "rnai-p_values.csv")
write_csv(wells_all %>% arrange(p_value),
paste0("../results/tables/rnai-p_values-.csv"))
6 changes: 3 additions & 3 deletions src/plot-plates.R
Expand Up @@ -7,11 +7,11 @@ suppressPackageStartupMessages({
library(viridis)
})

wells_all <- read.csv("rnai-p_values.csv") %>%
wells_all <- read.csv("../results/tables/rnai-p_values.csv") %>%
mutate(significant = p_value < 0.05)
binwidth <- 0.025

plot_save <- function(prefix, dir = "plots", extensions = c("png")) {
plot_save <- function(prefix, dir = "../results/plots", extensions = c("png")) {
invisible(sapply(file.path(dir, paste(prefix, extensions, sep = ".")),
ggplot2::ggsave, width = 8, height = 5,
units = "in"))
Expand Down Expand Up @@ -47,7 +47,7 @@ wells_repeated <- group_by(wells_all, symbol) %>%
print(summary(wells_repeated))

wells_repeated %>% merge(wells_all) %>% arrange(-coloc_stddev) %>%
write.csv("wells-stddev-descending.csv", row.names = FALSE)
write.csv("../results/tables/wells-stddev-descending.csv", row.names = FALSE)

ggplot(wells_repeated, aes(coloc_mean, coloc_stddev)) +
geom_point(aes(size = n_symbol), alpha = 0.5)
Expand Down
6 changes: 3 additions & 3 deletions src/plots.R
Expand Up @@ -11,15 +11,15 @@ suppressPackageStartupMessages({
## Do not generate Rplots.pdf
pdf(NULL)

wells_all <- read_csv("rnai-p_values.csv") %>%
wells_all <- read_csv("../results/tables/rnai-p_values.csv") %>%
mutate(significant = p_value < 0.05,
plate = factor(plate))
binwidth <- 0.025

theme_set(theme_bw())

plot_save <- function(prefix, dir = "plots",
extensions = c("png", "pdf", "svg"),
plot_save <- function(prefix, dir = "../results/plots",
extensions = c("png", "pdf"),
width = 8, height = 5) {
invisible(sapply(file.path(dir, paste(prefix, extensions, sep = ".")),
ggplot2::ggsave, width = width, height = height,
Expand Down

0 comments on commit eb9cab8

Please sign in to comment.