Skip to content

Companion code to the paper "Phase and context shapes the function of composite oncogenic mutations"

Notifications You must be signed in to change notification settings

taylor-lab/composite-mutations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Composite mutations

alt text

Instructions

Code in this repository can be used to recreate the essential parts of the main figures in the manuscript. All code is in R (>=3.5.0).

Install required R packages from CRAN and Bioconductor:

## check for missing required packages, install them
required.packages <- c('data.table','ggplot2','cowplot','RColorBrewer',
                       'parallel','ggsignif','binom','scales',
                       'MASS','ggrepel','Hmisc','Rcpp','pheatmap',
                       'car','here','magrittr','knitr','rmarkdown')

new.packages <- required.packages[!(required.packages %in% installed.packages()[,"Package"])]
if(length(new.packages)>0) install.packages(new.packages)

## install DESeq2 from Bioconductor if not installed
if(!'DESeq2' %in% installed.packages()) {
    if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager")
    BiocManager::install(c("DESeq2"))
}

(Optional) Several datasets used in this manuscript can take multiple hours to run. For convenience, precalculated results from these tests are available in the data/ directory. These can be regenerated with the following commands:

## generate data/gene_enrichment.txt
Rscript r/run_gene_enrichment_test.R

## generate data/residue_enrichment.txt
Rscript r/run_residue_enrichment_test.R

## generate data/observed_vs_expected_compounds_impact.rds; data/observed_vs_expected_compounds_tcga.rds
## warning: this can take hours to finish
Rscript r/run_cohort_permutation_tests.R

## generate data/observed_vs_expected_composites_per_tmb_impact.rds
## warning: this can take hours to finish
Rscript r/run_tmb_permutation_tests.R

## generate data/cancertype_enrichment_permutation_test.txt
## warning: this can only be run on a linux-based compute cluster 
## with LSF installed for job scheduling 
## (default resources requested per LSF job are 32GB RAM and 24 available cores)
Rscript r/run_cancertype_permutation_tests.R

Generate HTML files containing graphics for each main figure from the command line, which can be viewed in your web browser:

R -e "rmarkdown::render('html/figure-1.Rmd', output_file = 'figure-1.html')"
R -e "rmarkdown::render('html/figure-2.Rmd', output_file = 'figure-2.html')"
R -e "rmarkdown::render('html/figure-3.Rmd', output_file = 'figure-3.html')"
R -e "rmarkdown::render('html/figure-4.Rmd', output_file = 'figure-4.html')"

External Data Figures (EDF) can similarly be generated:

R -e "rmarkdown::render('html/figure-extended.Rmd', output_file = 'figure-extended.html')"

To generate an HTML file containing values references in the main text:

R -e "rmarkdown::render('html/text_values.Rmd', output_file = 'text_values.html')"

Citation

Contact

E-mail any questions to [email protected].

About

Companion code to the paper "Phase and context shapes the function of composite oncogenic mutations"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published