Skip to content

Commit

Permalink
small bug fixes to plotting code
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim committed Sep 26, 2021
1 parent 93581c3 commit 2b76b56
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Binary file modified sceptre_paper/manuscript/figures/FigureS4/FigureS4.pdf
Binary file not shown.
9 changes: 5 additions & 4 deletions sceptre_paper/plotting/FigureS4.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Reproduce Figure S3 from Katsevich, Barry, and Roeder (2020).
args <- commandArgs(trailingOnly = TRUE)
code_dir <- if (is.na(args[1])) "/Users/timbarry/Box/SCEPTRE/SCEPTRE/" else args[1]
code_dir <- paste0(.get_config_path("LOCAL_CODE_DIR"), "sceptre-manuscript")
require(katsevich2020)
require(ggrepel)
require(cowplot)
source(paste0(code_dir, "/sceptre_paper/plotting/load_data_for_plotting.R"))
figS3_dir <- paste0(manuscript_figure_dir, "/FigureS4")
figS4_dir <- paste0(manuscript_figure_dir, "/FigureS4")

resampling_results <- resampling_results_xie_cis
original_results <- ss_xie_cis %>% select('gene_id', 'gRNA_id', 'ss.down', 'reject.down') %>% dplyr::rename(rejected = reject.down)
Expand Down Expand Up @@ -111,14 +111,15 @@ p_b <- tibble(x, old_ecdf, new_ecdf) %>%
# subfigure c (Chip-seq)
my_order <- TF_enrichments_xie %>% filter(method == "SCEPTRE unique Virtual FACS") %>% pull(enrichment) %>% order()
ordered_labs <- (TF_enrichments_xie %>% filter(method == "SCEPTRE unique Virtual FACS") %>% pull(TF))[my_order]
p_c <- TF_enrichments_xie %>% arrange(desc(method)) %>%
p_c <- TF_enrichments_xie %>% arrange(desc(method)) %>%
filter(method %in% c("Virtual FACS unique", "SCEPTRE unique Virtual FACS")) %>%
mutate(method = factor(method, levels = c("Virtual FACS unique", "SCEPTRE unique Virtual FACS"),
labels = c("Virtual FACS", "SCEPTRE")),
TF = factor(TF,
levels = ordered_labs,
labels = ordered_labs)) %>%
ggplot(aes(x = TF, y = enrichment, fill = method)) +
geom_col(position = "dodge", width = 1.25) +
geom_col(position = "dodge", width = 0.9) +
geom_hline(yintercept = 1, linetype = "dashed") +
xlab("ChIP-seq target") + ylab("Enrichment (odds ratio)") + ggtitle("Enhancer ChIP-seq enrichment") +
scale_fill_manual(values = c(plot_colors[["hypergeometric"]], plot_colors[["sceptre"]])) +
Expand Down
2 changes: 1 addition & 1 deletion sceptre_paper/plotting/FigureS5.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Reproduce Figure S4 from Katsevich and Roeder (2020).
args <- commandArgs(trailingOnly = TRUE)
code_dir <- if (is.na(args[1])) "/Users/timbarry/Box/SCEPTRE/SCEPTRE/" else args[1]
code_dir <- paste0(.get_config_path("LOCAL_CODE_DIR"), "sceptre-manuscript")
require(katsevich2020)
source(paste0(code_dir, "/sceptre_paper/plotting/load_data_for_plotting.R"))
figS4_dir <- paste0(manuscript_figure_dir, "/FigureS4")
Expand Down

0 comments on commit 2b76b56

Please sign in to comment.