Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
OncoPrint figures (#1200)
Browse files Browse the repository at this point in the history
* Initial pass at histology palette overhaul

* Add display columns for legends

* Remove histology label palette NB from CI

* Add broad histology order

* Add oncoprint_include

* Add oncoprint grouping info to palette df

* Make cancer_group other darker; rerun

* Pretty sure change in #1161 was unintentional

* We have been manually editing the oncoprint palette I see

* Remove/move/rename to prep for an oncoprint fig2

* Missed the instance where I recode based on other hex code

* Rerun oncoprint now that palette is fixed

* Change up approach to oncoprint

* Remove oncoprint script that assembled from PNGs

* Remove oncoprint PNGs

* Add new oncoprint figure script

saves individual panels as PDFs, also uses new palette

* Add PDFs of oncoprints and legends

* Add PDF draft of assembled figure 2

* Update figure shell script

* Add fig 2 README

* Add PNG version of draft figure 2

* Tweak the cancer group palette

* Reorder HGAT legend; rerun with new palette

* Remove outdated assembled figure

* Add compiled versions

Sizing and spacing probably still need work!

* Update oncoprint palette

* Rerun module with new palette

* Rerun pub ready figure versions of oncoprints

* Add complex event to oncoprint palette

* Rerun module with complex event in palette

* Rerun oncoprint fig script with complex events

* Darker complex event hex code

* Try a "wine" color for complex event

* Remove outdated PNG & PDF of compiled fig

* Update figures/generate-figures.sh

Co-authored-by: Chante Bethell  <43576623+cbethell@users.noreply.github.com>

Co-authored-by: Chante Bethell  <43576623+cbethell@users.noreply.github.com>
  • Loading branch information
jaclyn-taroni and cbethell authored Jan 4, 2022
1 parent 32a81d2 commit ddb6a8c
Show file tree
Hide file tree
Showing 43 changed files with 475 additions and 124 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 7 additions & 8 deletions figures/generate-figures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ mkdir -p pdfs
Rscript --vanilla scripts/color_palettes.R
Rscript -e "rmarkdown::render('mapping-histology-labels.Rmd', clean = TRUE)"

################ Sample distribution
# Run sample distribution analysis
bash ${analyses_dir}/sample-distribution-analysis/run-sample-distribution.sh

# TODO: Rscript for figure (related: https://github.com/AlexsLemonade/OpenPBTA-analysis/issues/1175)

######################
## Interaction plots
Expand Down Expand Up @@ -77,14 +82,8 @@ bash ${analyses_dir}/oncoprint-landscape/run-oncoprint.sh
# Will create two plots - primary only and "primary plus" samples
filenames=(primary_only primary-plus)

for filename in "${filenames[@]}"; do

## Run the `oncoprint-landscape` figure assembly script
Rscript --vanilla scripts/oncoprint-landscape.R \
--lead_filename ${filename} \
--png_name pngs/${filename}_oncoprint_landscape.png

done
# Create single panel PDFs and legends
Rscript --vanilla scripts/fig2-oncoprint-landscape.R

####### Telomerase Activities

Expand Down
12 changes: 7 additions & 5 deletions figures/palettes/oncoprint_color_palette.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ In_Frame_Ins #FFE4E1
Stop_Codon_Ins #CC79A7
Start_Codon_Del #56B4E9
Fusion #7B68EE
Multi_Hit #00F021
Multi_Hit #CCCCCC
Hom_Deletion #313695
Hem_Deletion #abd9e9
amplification #c51b7d
loss #0072B2
gain #D55E00
High_Level_Gain #FF0000
Del #386db0
Amp #c51b7d
Multi_Hit_Fusion #CD96CD
Intron #5ea4fe
5'Flank #7CCBAC
3'Flank #FD8344
Complex_Event #571242
6 changes: 6 additions & 0 deletions figures/pdfs/fig2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### Figure 2

Figure 2 is compiled from the output of `figures/scripts/fig2-oncoprint-landscape.R`

The individual panels and legends can be found in `panels`.
They are compiled via Adobe Illustrator, saved as a PDF to this directory, and then a PNG file is exported to `figures/pngs`.
Binary file not shown.
Binary file added figures/pdfs/fig2/panels/germline_sex_legend.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed figures/pngs/fig1-openpbta-distribution.png
Binary file not shown.
Binary file removed figures/pngs/fig2-mutational-landscapes.png
Binary file not shown.
Binary file removed figures/pngs/primary-plus_oncoprint_landscape.png
Binary file not shown.
Binary file removed figures/pngs/primary_only_oncoprint_landscape.png
Binary file not shown.
30 changes: 17 additions & 13 deletions figures/scripts/color_palettes.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ divergent_df <- data.frame(color_names = divergent_color_names,
# col_fun <- circlize::colorRamp2(divergent_col_val,
# divergent_col_palette)

### 4) A binary color key which are the most extreme colors in the divergent color scale.
### 4) A binary color key which are the most extreme colors in the divergent color scale.
binary_col_palette <- c("#2166ac",
"#b2182b",
na_color)
Expand All @@ -124,14 +124,16 @@ oncoprint_col_palette <- c("#35978f",
"#CC79A7",
"#56B4E9",
"#7B68EE",
"#00F021",
"#CCCCCC",
"#313695",
"#abd9e9",
"#386db0",
"#c51b7d",
"#0072B2",
"#D55E00",
"#FF0000",
"#CD96CD")
"#CD96CD",
"#5ea4fe",
"#7CCBAC",
"#FD8344",
"#571242")

oncoprint_color_names <- c("Missense_Mutation",
"Nonsense_Mutation",
Expand All @@ -148,11 +150,13 @@ oncoprint_color_names <- c("Missense_Mutation",
"Multi_Hit",
"Hom_Deletion",
"Hem_Deletion",
"amplification",
"loss",
"gain",
"High_Level_Gain",
"Multi_Hit_Fusion")
"Del",
"Amp",
"Multi_Hit_Fusion",
"Intron",
"5'Flank",
"3'Flank",
"Complex_Event")

# Format as data.frame
oncoprint_df <- data.frame(color_names = oncoprint_color_names,
Expand All @@ -179,7 +183,7 @@ oncoprint_df <- data.frame(color_names = oncoprint_color_names,
# Cat this out
cat(swatches)
}

# Format as data.frame
tumor_descriptor_palette <- data.frame(color_names = c("Initial CNS Tumor",
"Progressive",
Expand All @@ -192,7 +196,7 @@ oncoprint_df <- data.frame(color_names = oncoprint_color_names,
"#FD8CC1FF",
"#FD7446FF")) %>%
readr::write_tsv(file.path(output_dir, "tumor_descriptor_palette.tsv"))

#
# Usage:
# Put whichever color palette you are updating into function.
Expand Down
Loading

0 comments on commit ddb6a8c

Please sign in to comment.