diff --git a/analyses/interaction-plots/plots/combined_top50.png b/analyses/interaction-plots/plots/combined_top50.png index cb9d18b489..8366e21971 100644 Binary files a/analyses/interaction-plots/plots/combined_top50.png and b/analyses/interaction-plots/plots/combined_top50.png differ diff --git a/analyses/interaction-plots/plots/cooccur_top50.ALL.png b/analyses/interaction-plots/plots/cooccur_top50.ALL.png index 7b4eb03a34..aef8f68331 100644 Binary files a/analyses/interaction-plots/plots/cooccur_top50.ALL.png and b/analyses/interaction-plots/plots/cooccur_top50.ALL.png differ diff --git a/analyses/interaction-plots/plots/cooccur_top50.Craniopharyngioma.png b/analyses/interaction-plots/plots/cooccur_top50.Craniopharyngioma.png index 51436345fa..7b2b024f22 100644 Binary files a/analyses/interaction-plots/plots/cooccur_top50.Craniopharyngioma.png and b/analyses/interaction-plots/plots/cooccur_top50.Craniopharyngioma.png differ diff --git a/analyses/interaction-plots/plots/cooccur_top50.DMG.png b/analyses/interaction-plots/plots/cooccur_top50.DMG.png index 8be0e1f6ab..ea14c1b4dc 100644 Binary files a/analyses/interaction-plots/plots/cooccur_top50.DMG.png and b/analyses/interaction-plots/plots/cooccur_top50.DMG.png differ diff --git a/analyses/interaction-plots/plots/cooccur_top50.Ependymoma.png b/analyses/interaction-plots/plots/cooccur_top50.Ependymoma.png index f40270ee04..b3c8eae9bb 100644 Binary files a/analyses/interaction-plots/plots/cooccur_top50.Ependymoma.png and b/analyses/interaction-plots/plots/cooccur_top50.Ependymoma.png differ diff --git a/analyses/interaction-plots/plots/cooccur_top50.Ganglioglioma.png b/analyses/interaction-plots/plots/cooccur_top50.Ganglioglioma.png index 957cd90129..e6d2c12ae8 100644 Binary files a/analyses/interaction-plots/plots/cooccur_top50.Ganglioglioma.png and b/analyses/interaction-plots/plots/cooccur_top50.Ganglioglioma.png differ diff --git a/analyses/interaction-plots/plots/cooccur_top50.HGAT.png b/analyses/interaction-plots/plots/cooccur_top50.HGAT.png index 129db1f227..925d49a761 100644 Binary files a/analyses/interaction-plots/plots/cooccur_top50.HGAT.png and b/analyses/interaction-plots/plots/cooccur_top50.HGAT.png differ diff --git a/analyses/interaction-plots/plots/cooccur_top50.LGAT.png b/analyses/interaction-plots/plots/cooccur_top50.LGAT.png index 872211a6a1..5bb6d19632 100644 Binary files a/analyses/interaction-plots/plots/cooccur_top50.LGAT.png and b/analyses/interaction-plots/plots/cooccur_top50.LGAT.png differ diff --git a/analyses/interaction-plots/plots/cooccur_top50.Medulloblastoma.png b/analyses/interaction-plots/plots/cooccur_top50.Medulloblastoma.png index 70ddba069d..5bc6c4f278 100644 Binary files a/analyses/interaction-plots/plots/cooccur_top50.Medulloblastoma.png and b/analyses/interaction-plots/plots/cooccur_top50.Medulloblastoma.png differ diff --git a/analyses/interaction-plots/scripts/03-plot_interactions.R b/analyses/interaction-plots/scripts/03-plot_interactions.R index d0ee67d6d5..4f2f4b01c0 100644 --- a/analyses/interaction-plots/scripts/03-plot_interactions.R +++ b/analyses/interaction-plots/scripts/03-plot_interactions.R @@ -87,6 +87,10 @@ if (!is.na(opts$disease_table)){ cooccur_file <- opts$infile plot_file <- opts$outfile +# get root directory +root_dir <- rprojroot::find_root(rprojroot::has_dir(".git")) + + cooccur_df <- readr::read_tsv(cooccur_file, col_types = readr::cols()) %>% dplyr::mutate( @@ -114,6 +118,23 @@ cooccur_df <- cooccur_df %>% ) +# Get color palettes + +palette_dir <- file.path(root_dir, "figures", "palettes") +divergent_palette <- readr::read_tsv(file.path(palette_dir, "divergent_color_palette.tsv"), + col_types = readr::cols()) +divergent_colors <- divergent_palette %>% + dplyr::filter(color_names != "na_color") %>% + dplyr::pull(hex_codes) +na_color <- divergent_palette %>% + dplyr::filter(color_names == "na_color") %>% + dplyr::pull(hex_codes) +# not currently using "histologies_color_palette.tsv" as the current +# implementation uses `integrated_diagnosis``, which is not covered in that color scheme +# Since we are only showing the most common subset of diseases, we don't need all colors, +# but this should probably be updated in the future + + # create scales for consistent sizing # The scales will need to have opts$plotsize elements, # so after getting the unique list, we concatenate on extra elements. @@ -145,9 +166,9 @@ cooccur_plot <- ggplot( limits = yscale, breaks = unique(cooccur_df$label2) ) + - scale_fill_distiller( - type = "div", - palette = 5, + scale_fill_gradientn( + colors = divergent_colors, + na.value = na_color, limits = c(-10, 10), oob = scales::squish, ) + @@ -213,6 +234,7 @@ disease_plot <- ggplot( y = "Samples with mutations", fill = "Diagnosis" ) + + # TODO: update to project color scheme (currently requires translation of disease to short_histology) colorblindr::scale_fill_OkabeIto() + scale_x_discrete( limits = xscale2, diff --git a/figures/pngs/combined_top50.png b/figures/pngs/mutation_cooccurrence_figure.png similarity index 100% rename from figures/pngs/combined_top50.png rename to figures/pngs/mutation_cooccurrence_figure.png