From 2b76b5636fcf519195eee2c4b329de88630aed77 Mon Sep 17 00:00:00 2001 From: Tim Date: Sun, 26 Sep 2021 16:28:08 -0400 Subject: [PATCH] small bug fixes to plotting code --- .../manuscript/figures/FigureS4/FigureS4.pdf | Bin 6020 -> 10529 bytes sceptre_paper/plotting/FigureS4.R | 9 +++++---- sceptre_paper/plotting/FigureS5.R | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sceptre_paper/manuscript/figures/FigureS4/FigureS4.pdf b/sceptre_paper/manuscript/figures/FigureS4/FigureS4.pdf index db02852abd191b848e14138e4013143b935a441c..1aeffaee5cbbcac218c81f91fc7de3918dfcdba2 100644 GIT binary patch delta 6831 zcma)B30zWX_nxU~8Cv{i(Izc*+O-mKUl69uY}#zp8K+G78(NtP<%UaoryBDsQ>QGk zMX4+q$CO-21*u4#8B#PCQbfhw2zNk5;D7H$ZSTwT`+4EQd(L^!dEWCpSAR#|a{j|& zt+j~-%EH9N%)$VH+(Y!<<`wLtzhRq=iLnXFc=of4?uPTsjEs#;FP_i-!otMZI?49) zRX~HlgS4XZ#Bah#<@w?@$c03=ke^AoYi4WRPn`VrtIBHYWaLpq!G>@4ZFByomc`vI ziwmZ?DyaNY^3~B@?f%_?i8P@%70lMTI$e1XWeNO)4CKi z`Z5kKIcotcT-MO*luRDfy(7W$V(NG#qy`X2!LYoBN2x%wlD4Hp(h=mz%zlycaN$2d(iHorI^ZjbS(-rdNu6y0KIbE@*+%%#`CxUYGraA>B+YR$P z4Uz*?lCyQPhKBrOo%QCFZY}bFlq_tB_({?H>{7Kq(7Z;{+;MJiQO*-1qv~$p-io1B zJS}b*=SVW4eCEsBvIzF_PDaI(ucJelE9-oZ#Ct&6b;Wmem-f^uw{U0cUHtuH0rHXh%KXb7Hd%F~74or_ ze9vfQf<4Y%jPsA%Eo!W3RQxp&x|c5)$!&=`vwL%DI69<6o>|Ugd1EAn*{1+PX$vFv zcTTD^dbBp%U-k=7710=~cuMhzl6So5F6VbEWSo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-}7^G2Y}TekmPbLb2F%s5nK)YqttGz0sh;7p>Qbj zUkqUc{x>s*B}285a5xO{uLU>)`hSN5{9L?lx%mOmXf;DSuVA+y_RHFuB5-3U6aWHQ I+FStq19(Vv`v3p{ diff --git a/sceptre_paper/plotting/FigureS4.R b/sceptre_paper/plotting/FigureS4.R index eff7176..37dbb8f 100644 --- a/sceptre_paper/plotting/FigureS4.R +++ b/sceptre_paper/plotting/FigureS4.R @@ -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) @@ -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"]])) + diff --git a/sceptre_paper/plotting/FigureS5.R b/sceptre_paper/plotting/FigureS5.R index 5a62f7d..f77a54f 100644 --- a/sceptre_paper/plotting/FigureS5.R +++ b/sceptre_paper/plotting/FigureS5.R @@ -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")