Last updated: 2021-04-20

Checks: 7 0

Knit directory: methyl-geneset-testing/

This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it's best to always run the code in an empty environment.

The command set.seed(20200302) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 9d23572. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .DS_Store
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    analysis/figures.nb.html
    Ignored:    code/.DS_Store
    Ignored:    code/.Rhistory
    Ignored:    code/.job/
    Ignored:    code/old/
    Ignored:    data/.DS_Store
    Ignored:    data/annotations/
    Ignored:    data/cache-intermediates/
    Ignored:    data/cache-region/
    Ignored:    data/cache-rnaseq/
    Ignored:    data/cache-runtime/
    Ignored:    data/datasets/.DS_Store
    Ignored:    data/datasets/GSE110554-data.RData
    Ignored:    data/datasets/GSE120854/
    Ignored:    data/datasets/GSE120854_RAW.tar
    Ignored:    data/datasets/GSE135446-data.RData
    Ignored:    data/datasets/GSE135446/
    Ignored:    data/datasets/GSE135446_RAW.tar
    Ignored:    data/datasets/GSE45459-data.RData
    Ignored:    data/datasets/GSE45459_Matrix_signal_intensities.txt
    Ignored:    data/datasets/GSE45460/
    Ignored:    data/datasets/GSE45460_RAW.tar
    Ignored:    data/datasets/GSE95460_RAW.tar
    Ignored:    data/datasets/GSE95460_RAW/
    Ignored:    data/datasets/GSE95462-data.RData
    Ignored:    data/datasets/GSE95462/
    Ignored:    data/datasets/GSE95462_RAW/
    Ignored:    data/datasets/SRP100803/
    Ignored:    data/datasets/SRP125125/.DS_Store
    Ignored:    data/datasets/SRP125125/SRR6298*/
    Ignored:    data/datasets/SRP125125/SRR_Acc_List.txt
    Ignored:    data/datasets/SRP125125/SRR_Acc_List_Full.txt
    Ignored:    data/datasets/SRP125125/SraRunTable.txt
    Ignored:    data/datasets/SRP125125/multiqc_data/
    Ignored:    data/datasets/SRP125125/multiqc_report.html
    Ignored:    data/datasets/SRP125125/quants/
    Ignored:    data/datasets/SRP166862/
    Ignored:    data/datasets/SRP217468/
    Ignored:    data/datasets/TCGA.BRCA.rds
    Ignored:    data/datasets/TCGA.KIRC.rds
    Ignored:    data/misc/
    Ignored:    output/.DS_Store
    Ignored:    output/FDR-analysis/
    Ignored:    output/compare-methods/
    Ignored:    output/figures/
    Ignored:    output/methylgsa-params/
    Ignored:    output/outputs.tar.gz
    Ignored:    output/random-cpg-sims/

Untracked files:
    Untracked:  analysis/old/

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/figures.Rmd) and HTML (docs/figures.html) files. If you've configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 72f9d4c JovMaksimovic 2021-04-19 Fixed issues with supp fig 3 and 15.
html 4c57176 JovMaksimovic 2021-04-13 Build site.
Rmd 910609a JovMaksimovic 2021-04-13 Fixed supp fig 3
Rmd 4b03471 JovMaksimovic 2021-04-13 Updated code for generating figures
Rmd 697c330 JovMaksimovic 2021-04-12 Updated figure numbering and labels
Rmd a64bf72 Jovana Maksimovic 2021-04-12 Added panels to supp fig 3
Rmd 5e34ed3 JovMaksimovic 2021-04-12 Figure updates
html bbf77e1 JovMaksimovic 2020-08-21 Build site.
Rmd e3b14f4 JovMaksimovic 2020-08-21 wflow_publish(c("analysis/01_exploreArrayBiasEPIC.Rmd", "analysis/02_exploreArrayBias450.Rmd",
html e66c39a JovMaksimovic 2020-08-14 Build site.
Rmd ad9e7be JovMaksimovic 2020-08-14 wflow_publish(c("analysis/figures.Rmd", "analysis/gettingStarted.Rmd",
html 555069b JovMaksimovic 2020-08-14 Build site.
Rmd 91699a8 JovMaksimovic 2020-08-14 wflow_publish("analysis/_site.yml", republish = TRUE, all = TRUE)
Rmd 2be6153 JovMaksimovic 2020-07-14 Updated code for generating manuscript figures.
Rmd cfcac1b Jovana Maksimovic 2020-07-09 Updated paper figures.

library(here)
here() starts at /Users/maksimovicjovana/Work/Research/methyl-geneset-testing
library(patchwork)
library(ggplot2)
library(limma)
library(tidyverse)
── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
✓ tibble  3.1.0     ✓ dplyr   1.0.5
✓ tidyr   1.1.3     ✓ stringr 1.4.0
✓ readr   1.4.0     ✓ forcats 0.5.1
✓ purrr   0.3.4     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
x dplyr::filter() masks stats::filter()
x dplyr::lag()    masks stats::lag()
library(ggplotify)
library(UpSetR)
source(here("code/utility.R"))
options(scipen=10000)

The code in this document produces all of the panel figures in our manuscript and saves them as PDF files in the output/figures directory.

Figures

Figure 1

a <- readRDS(here("output/figures/Fig-1A.rds"))
b <- readRDS(here("output/figures/Fig-1B.rds"))
c <- readRDS(here("output/figures/Fig-1C.rds"))
d <- readRDS(here("output/figures/Fig-1D.rds"))

layout <- "
AAAABB
CCDDDD
"
cairo_pdf(here("output/figures/Fig-1.pdf"), width = 9)
a + b+ c + theme(legend.position = "bottom") + 
    wrap_elements(panel = d, clip = FALSE) + 
    plot_layout(design = layout) + 
    plot_annotation(tag_levels = 'A') &
    theme(plot.tag = element_text(size = 14, face = "bold"))
`geom_smooth()` using method = 'loess' and formula 'y ~ x'
dev.off()
quartz_off_screen 
                2 

Figure 3

a <- readRDS(here("output/figures/Fig-3A.rds"))
b <- readRDS(here("output/figures/Fig-3B.rds"))
c <- readRDS(here("output/figures/Fig-3C.rds"))
d <- readRDS(here("output/figures/Fig-3D.rds"))

layout <- "
AABBBB
CCDDDD
"

b$layers[[4]]$aes_params$size <- 2.1

cairo_pdf(here("output/figures/Fig-3.pdf"), width = 9)
a + theme(legend.position = "none") + 
    b + theme(legend.position = "top",
              legend.key.size = unit(1, "lines")) +
    c + theme(legend.position = "bottom",
              legend.key.size = unit(1, "lines")) + 
    d + theme(legend.position = "bottom",
              legend.text = element_text(size = 8), 
              legend.key.size = unit(1, "lines"),
              axis.title.y = element_text(size = 9.5)) +
    plot_layout(design = layout) + 
    plot_annotation(tag_levels = 'A') &
    theme(plot.tag = element_text(size = 14, face = "bold"))
dev.off()
quartz_off_screen 
                2 

Figure 4

a <- readRDS(here("output/figures/Fig-4A.rds"))
b <- readRDS(here("output/figures/Fig-4B.rds"))
c <- readRDS(here("output/figures/Fig-4C.rds"))
d <- readRDS(here("output/figures/Fig-4D.rds"))

layout <- "
AACCCC
AACCCC
BBCCCC
BBCCCC
DDDDDD
DDDDDD
DDDDDD
DDDDDD
DDDDDD
DDDDDD
DDDDDD
DDDDDD
DDDDDD
DDDDDD
DDDDDD
DDDDDD
"        
cairo_pdf(here("output/figures/Fig-4.pdf"), width = 8, height = 12)
a + theme(legend.position = "bottom", 
          legend.key.size = unit(0.75, "lines"),
          legend.text = element_text(size = 7),
          legend.title = element_text(size = 8),
          legend.box.just = 0,
          axis.title = element_text(size = 8),
          plot.margin = margin(0,0,0,0)) +
    b + theme(legend.position = "bottom", 
              legend.key.size = unit(0.75, "lines"),
              legend.text = element_text(size = 7),
              legend.title = element_text(size = 8),
              legend.box.just = 0,
              axis.title.y = element_text(size = 7),
              axis.text = element_text(size = 7),
              plot.margin = margin(0,0,0,0)) +
    c + guides(colour = guide_legend(ncol = 3)) +
    theme(legend.position = "bottom",
          legend.key.size = unit(1, "lines"),
          legend.text = element_text(size = 8),
          legend.title = element_text(size = 9),
          plot.title = element_blank(),
          axis.title = element_text(size = 9)) +
    labs(y = "Prop. top 100 terms in truth set") +
    wrap_elements(d) +
    plot_layout(design = layout) +
    plot_annotation(tag_levels = 'A') &
    theme(plot.tag = element_text(size = 14, face = "bold"))
dev.off()
quartz_off_screen 
                2 

Figure 5

a <- readRDS(here("output/figures/Fig-5A.rds"))
b <- readRDS(here("output/figures/Fig-5B.rds"))
c <- readRDS(here("output/figures/Fig-5C.rds"))
d <- readRDS(here("output/figures/Fig-5D.rds"))
e <- readRDS(here("output/figures/Fig-5E.rds"))
f <- readRDS(here("output/figures/Fig-5F.rds"))
g <- readRDS(here("output/figures/Fig-5G.rds"))

layout <- "
AAACCCCC
AAACCCCC
BBBCCCCC
BBBCCCCC
DDDDDDDD
DDDDDDDD
DDDDDDDD
DDDDDDDD
DDDDDDDD
DDDDDDDD
EEEFFGGG
EEEFFGGG
EEEFFGGG
EEEFFGGG
EEEFFGGG
EEEFFGGG
"     

cairo_pdf(here("output/figures/Fig-5.pdf"), width = 9, height = 10)
a + theme(legend.position = "bottom", 
          legend.key.size = unit(0.75, "lines"),
          legend.text = element_text(size = 8),
          legend.title = element_text(size = 9),
          legend.box.just = 0,
          axis.title = element_text(size = 9),
          axis.text = element_text(size = 8),
          text = element_text(family = "arial")) +
    b + guides(fill = guide_legend(ncol = 3)) +
    theme(legend.position = "bottom",
          legend.key.size = unit(1, "lines"),
          legend.text = element_text(size = 8),
          legend.title = element_text(size = 9),
          plot.title = element_blank(),
          axis.title = element_text(size = 8),
          text = element_text(family = "arial")) +
    c + theme(legend.position = "bottom", 
              legend.key.size = unit(1, "lines"),
              legend.text = element_text(size = 8),
              legend.title = element_text(size = 9),
              legend.box.just = 0,
              plot.title = element_blank(),
              axis.title = element_text(size = 8),
              text = element_text(family = "arial")) +
    wrap_elements(d + theme(plot.title = element_blank(),
                            legend.box = "horizontal",
                            legend.text = element_text(size = 7),
                            legend.key.size = unit(1, "lines"),
                            legend.title = element_text(size = 8),
                            axis.text.y = element_text(size = 7),
                            text = element_text(family = "arial"))) +
    wrap_elements(panel = e, clip = FALSE) +
    wrap_elements(panel = f + theme(axis.title = element_text(size = 9)), 
                  clip = FALSE) +
    wrap_elements(panel = g, clip = FALSE) +
    plot_layout(design = layout) +
    plot_annotation(tag_levels = 'A') &
    theme(plot.tag = element_text(size = 14, face = "bold"))
`geom_smooth()` using method = 'loess' and formula 'y ~ x'
dev.off()
quartz_off_screen 
                2 

Supplementary Figures

Supplementary Figure 1

a <- readRDS(here("output/figures/SFig-1A.rds"))
b <- readRDS(here("output/figures/SFig-1B.rds"))

layout <- "
AAA
BBB
"
cairo_pdf(here("output/figures/SFig-01.pdf"))
a + wrap_elements(b) + 
    plot_layout(design = layout) + 
    plot_annotation(tag_levels = 'A') &
    theme(plot.tag = element_text(size = 14, face = "bold"))
dev.off()
quartz_off_screen 
                2 

Supplementary Figure 3

a <- readRDS(here("output/figures/SFig-3A.rds"))
b <- readRDS(here("output/figures/SFig-3B.rds"))
c <- readRDS(here("output/figures/SFig-3C.rds"))
d <- readRDS(here("output/figures/SFig-3D.rds"))
e <- readRDS(here("output/figures/SFig-3E.rds"))

layout <- "
AABBBB
CCDDDD
EEEEEE
EEEEEE
EEEEEE
"

d$layers[[2]]$aes_params$size <- 0.2
a$layers[[1]]$aes_params$size <- 0.25
b$layers[[4]]$aes_params$size <- 2.1

cairo_pdf(here("output/figures/SFig-03.pdf"), width = 9, height = 13)
a + theme(legend.position = "none", 
          axis.title = element_text(size = 9)) + 
    b + theme(axis.title.x = element_text(size = 9),
              axis.title.y = element_text(size = 8),
              legend.position = "top",
              legend.text = element_text(size = 8),
              legend.title = element_text(size = 9)) + 
    c + theme(axis.title = element_text(size = 9),
              legend.position = "bottom",
              legend.text = element_text(size = 8),
              legend.title = element_text(size = 9)) +
    d + theme(axis.title.x = element_text(size = 9),
              axis.title.y = element_text(size = 8),
              legend.position = "bottom",
              legend.text = element_text(size = 7),
              legend.title = element_text(size = 9, angle = 90)) +
    wrap_elements(e) +
    plot_layout(design = layout) + 
    plot_annotation(tag_levels = 'A') &
    theme(plot.tag = element_text(size = 14, face = "bold"))
dev.off()
quartz_off_screen 
                2 

Supplementary Figure 4

a <- readRDS(here("output/figures/SFig-4A.rds"))
b <- readRDS(here("output/figures/SFig-4B.rds"))
c <- readRDS(here("output/figures/SFig-4C.rds"))
d <- readRDS(here("output/figures/SFig-4D.rds"))
e <- readRDS(here("output/figures/SFig-4E.rds"))
f <- readRDS(here("output/figures/SFig-4F.rds"))
g <- readRDS(here("output/figures/SFig-4G.rds"))

layout <- "
AAABBB
CCCDDD
EEEEEE
FFFGGG
"

cairo_pdf(here("output/figures/SFig-04.pdf"), width = 8, height = 10)
a + scale_y_continuous(labels = scales::scientific) +
    theme(legend.position = "right", 
          legend.box = "vertical",
          legend.text = element_text(size = 7),
          legend.title = element_text(size = 8),
          axis.title = element_text(size = 9),
          axis.text.x = element_text(size = 5)) +
    b + theme(legend.box = "vertical",
              legend.text = element_text(size = 7),
              legend.title = element_text(size = 8),
              axis.title = element_text(size = 9),
              axis.text.x = element_text(size = 5)) +
    c + theme(legend.text = element_text(size = 7),
              legend.title = element_text(size = 8)) +
    d + theme(legend.text = element_text(size = 8),
              legend.title = element_text(size = 8),
              axis.title = element_text(size = 8),
              axis.text = element_text(size = 7),
              legend.position = "bottom") +
    e + theme(legend.position = "bottom") +
    f +
    g + theme(legend.text = element_text(size = 8),
              legend.title = element_text(size = 8),
              axis.title = element_text(size = 8),
              legend.position = "right") +
    plot_layout(design = layout) +
    plot_annotation(tag_levels = 'A') &
    theme(plot.tag = element_text(size = 14, face = "bold"))
dev.off()
quartz_off_screen 
                2 

Supplementary Figure 5

a <- readRDS(here("output/figures/SFig-5A.rds"))
b <- readRDS(here("output/figures/SFig-5B.rds"))

layout <- "
AAAA
BBBB
BBBB
BBBB
"        
cairo_pdf(here("output/figures/SFig-05.pdf"), width = 8, height = 9)
wrap_elements(a + theme(plot.title = element_blank(),
                        axis.title = element_text(size = 9),
                        legend.position = "right") +
                  labs(y = "Prop. top 100 terms in truth set")) +
    wrap_elements(b) +
    plot_layout(design = layout) +
    plot_annotation(tag_levels = 'A') &
    theme(plot.tag = element_text(size = 14, face = "bold"))
dev.off()
quartz_off_screen 
                2 

Supplementary Figure 6

a <- readRDS(here("output/figures/SFig-6A.rds"))
b <- readRDS(here("output/figures/SFig-6B.rds"))

layout <- "
AAAA
BBBB
BBBB
BBBB
"        
cairo_pdf(here("output/figures/SFig-06.pdf"), width = 8, height = 9)
wrap_elements(a + theme(plot.title = element_blank(),
                        axis.title = element_text(size = 9),
                        legend.position = "right") +
                  labs(y = "Prop. top 100 terms in truth set")) +
    wrap_elements(b) +
    plot_layout(design = layout) +
    plot_annotation(tag_levels = 'A') &
    theme(plot.tag = element_text(size = 14, face = "bold"))
dev.off()
quartz_off_screen 
                2 

Supplementary Figure 7

a <- readRDS(here("output/figures/SFig-7A.rds"))
b <- readRDS(here("output/figures/SFig-7B.rds"))
c <- readRDS(here("output/figures/SFig-7C.rds"))
d <- readRDS(here("output/figures/SFig-7D.rds"))
e <- readRDS(here("output/figures/SFig-7E.rds"))

layout <- "
AAAA
AAAA
BBBB
BBBB
CCCC
CCCC
CCCC
CCCC
DDDD
DDDD
DDDD
DDDD
EEEE
EEEE
EEEE
EEEE
"        
cairo_pdf(here("output/figures/SFig-07.pdf"), width = 8, height = 22)
wrap_elements((a + plot_layout(guides = "collect") & 
                   theme(legend.box = "vertical", 
                         legend.position = "right"))) +
    wrap_elements((b + plot_layout(guides = "collect") & 
                       theme(legend.box = "vertical",
                             legend.position = "right"))) +
    c + 
    d +
    e +
    plot_layout(design = layout) +
    plot_annotation(tag_levels = 'A') &
    theme(plot.tag = element_text(size = 14, face = "bold"))
dev.off()
quartz_off_screen 
                2 

Supplementary Figure 8

f8a <- readRDS(here("output/figures/SFig-8A.rds"))
f8b <- readRDS(here("output/figures/SFig-8B.rds"))
f8c <- readRDS(here("output/figures/SFig-8C.rds"))
f8d <- readRDS(here("output/figures/SFig-8D.rds"))

layout <- "
AACCCC
AACCCC
BBCCCC
BBCCCC
DDDDDD
DDDDDD
DDDDDD
DDDDDD
DDDDDD
DDDDDD
DDDDDD
DDDDDD
DDDDDD
DDDDDD
"        
cairo_pdf(here("output/figures/SFig-08.pdf"), width = 8, height = 12)
f8a + theme(legend.position = "bottom", 
            legend.key.size = unit(0.75, "lines"),
            legend.text = element_text(size = 7),
            legend.title = element_text(size = 8),
            legend.box.just = 0,
            axis.title = element_text(size = 8),
            plot.margin = margin(0,0,0,0)) +
    f8b + theme(legend.position = "bottom", 
                legend.key.size = unit(0.75, "lines"),
                legend.text = element_text(size = 7),
                legend.title = element_text(size = 8),
                legend.box.just = 0,
                axis.title.y = element_text(size = 7),
                axis.text = element_text(size = 7),
                plot.margin = margin(0,0,0,0)) +
    f8c + guides(colour = guide_legend(ncol = 3)) +
    theme(legend.position = "bottom",
          legend.key.size = unit(1, "lines"),
          legend.text = element_text(size = 8),
          legend.title = element_text(size = 9),
          plot.title = element_blank(),
          axis.title = element_text(size = 9)) +
    labs(y = "Prop. top 100 terms in truth set") +
    wrap_elements(f8d) +
    plot_layout(design = layout) +
    plot_annotation(tag_levels = 'A') &
    theme(plot.tag = element_text(size = 14, face = "bold"))
dev.off()
quartz_off_screen 
                2 

Supplementary Figure 9

a <- readRDS(here("output/figures/SFig-9A.rds"))
b <- readRDS(here("output/figures/SFig-9B.rds"))

layout <- "
AAAA
BBBB
BBBB
BBBB
"        
cairo_pdf(here("output/figures/SFig-09.pdf"), width = 8, height = 9)
wrap_elements(a + theme(plot.title = element_blank(),
                        axis.title = element_text(size = 9),
                        legend.position = "right") +
                  labs(y = "Prop. top 100 terms in truth set")) +
    wrap_elements(b) +
    plot_layout(design = layout) +
    plot_annotation(tag_levels = 'A') &
    theme(plot.tag = element_text(size = 14, face = "bold"))
dev.off()
quartz_off_screen 
                2 

Supplementary Figure 10

a <- readRDS(here("output/figures/SFig-10A.rds"))
b <- readRDS(here("output/figures/SFig-10B.rds"))
c <- readRDS(here("output/figures/SFig-10C.rds"))
d <- readRDS(here("output/figures/SFig-10D.rds"))
e <- readRDS(here("output/figures/SFig-10E.rds"))
f <- readRDS(here("output/figures/SFig-10F.rds"))

layout <- "
AAABBBBB
CCCCCCCC
CCCCCCCC
DDDEEFFF
DDDEEFFF
"    

cairo_pdf(here("output/figures/SFig-10.pdf"), width = 8, height = 9)
a + guides(fill = guide_legend(ncol = 3)) +
    theme(legend.position = "bottom",
          legend.key.size = unit(1, "lines"),
          legend.text = element_text(size = 8),
          legend.title = element_text(size = 9),
          plot.title = element_blank(),
          axis.title = element_text(size = 8)) +
    labs(y = "Prop. top 100 terms in truth set") +
    b + theme(legend.position = "bottom", 
              legend.key.size = unit(1, "lines"),
              legend.text = element_text(size = 8),
              legend.title = element_text(size = 9),
              legend.box.just = 0,
              plot.title = element_blank(),
              axis.title = element_text(size = 8)) +
    wrap_elements(c + theme(plot.title = element_blank(),
                            legend.box = "horizontal",
                            legend.text = element_text(size = 7),
                            legend.key.size = unit(1, "lines"),
                            legend.title = element_text(size = 8),
                            axis.text.y = element_text(size = 7))) +
    wrap_elements(panel = d, clip = FALSE) +
    wrap_elements(panel = e + theme(axis.title = element_text(size = 8)), 
                  clip = FALSE) +
    wrap_elements(panel = f, clip = FALSE) +
    plot_layout(design = layout) +
    plot_annotation(tag_levels = 'A') &
    theme(plot.tag = element_text(size = 14, face = "bold"))
`geom_smooth()` using method = 'loess' and formula 'y ~ x'
dev.off()
quartz_off_screen 
                2 

Supplementary Figure 11

a <- readRDS(here("output/figures/SFig-11A.rds"))
b <- readRDS(here("output/figures/SFig-11B.rds"))
c <- readRDS(here("output/figures/SFig-11C.rds"))
d <- readRDS(here("output/figures/SFig-11D.rds"))
e <- readRDS(here("output/figures/SFig-11E.rds"))
f <- readRDS(here("output/figures/SFig-11F.rds"))

layout <- "
AAABBBBB
CCCCCCCC
CCCCCCCC
DDDEEFFF
DDDEEFFF
"          
cairo_pdf(here("output/figures/SFig-11.pdf"), width = 8, height = 9)
a + guides(fill = guide_legend(ncol = 3)) +
    theme(legend.position = "bottom",
          legend.key.size = unit(1, "lines"),
          legend.text = element_text(size = 8),
          legend.title = element_text(size = 9),
          plot.title = element_blank(),
          axis.title = element_text(size = 8)) +
    labs(y = "Prop. top 100 terms in truth set") +
    b + theme(legend.position = "bottom", 
              legend.key.size = unit(1, "lines"),
              legend.text = element_text(size = 8),
              legend.title = element_text(size = 9),
              legend.box.just = 0,
              plot.title = element_blank(),
              axis.title = element_text(size = 8)) +
    wrap_elements(c + theme(plot.title = element_blank(),
                            legend.box = "horizontal",
                            legend.text = element_text(size = 7),
                            legend.key.size = unit(1, "lines"),
                            legend.title = element_text(size = 8),
                            axis.text.y = element_text(size = 7))) +
    wrap_elements(panel = d, clip = FALSE) +
    wrap_elements(panel = e + theme(axis.title = element_text(size = 8)), 
                  clip = FALSE) +
    wrap_elements(panel = f, clip = FALSE) +
    plot_layout(design = layout) +
    plot_annotation(tag_levels = 'A') &
    theme(plot.tag = element_text(size = 14, face = "bold"))
`geom_smooth()` using method = 'loess' and formula 'y ~ x'
dev.off()
quartz_off_screen 
                2 

Supplementary Figure 12

a <- readRDS(here("output/figures/SFig-12A.rds"))
b <- readRDS(here("output/figures/SFig-12B.rds"))
c <- readRDS(here("output/figures/SFig-12C.rds"))
d <- readRDS(here("output/figures/SFig-12D.rds"))
e <- readRDS(here("output/figures/SFig-12E.rds"))

layout <- "
AAAA
BBBB
CCCC
CCCC
CCCC
CCCC
DDDD
DDDD
DDDD
DDDD
EEEE
EEEE
EEEE
EEEE
"        
cairo_pdf(here("output/figures/SFig-12.pdf"), width = 8, height = 17)
a + theme(legend.position = "right", 
          axis.title.y = element_text(size = 8)) +
    b + theme(legend.position = "none", 
              axis.title.y = element_text(size = 8)) +
    c + 
    d +
    e +
    plot_layout(design = layout) +
    plot_annotation(tag_levels = 'A') &
    theme(plot.tag = element_text(size = 14, face = "bold"))
dev.off()
quartz_off_screen 
                2 

Supplementary Figure 13

a <- readRDS(here("output/figures/SFig-13A.rds"))
b <- readRDS(here("output/figures/SFig-13B.rds"))

layout <- "
AAAA
BBBB
"        
cairo_pdf(here("output/figures/SFig-13.pdf"), width = 9)
a + b +
    plot_layout(design = layout, guides = "collect") +
    plot_annotation(tag_levels = 'A') &
    theme(plot.tag = element_text(size = 14, face = "bold"))
dev.off()
quartz_off_screen 
                2 

Supplementary Figure 14

a <- readRDS(here("output/figures/SFig-14A.rds"))
b <- readRDS(here("output/figures/SFig-14B.rds"))
c <- readRDS(here("output/figures/SFig-14C.rds"))
d <- readRDS(here("output/figures/SFig-14D.rds"))
e <- readRDS(here("output/figures/SFig-14E.rds"))
f <- readRDS(here("output/figures/SFig-14F.rds"))

layout <- "
AAABBBBB
CCCCCCCC
CCCCCCCC
DDDEEFFF
DDDEEFFF
"    

cairo_pdf(here("output/figures/SFig-14.pdf"), width = 8, height = 9)
a + theme(legend.position = "bottom", 
          legend.key.size = unit(0.75, "lines"),
          legend.text = element_text(size = 8),
          legend.title = element_text(size = 9),
          legend.box.just = 0,
          axis.title = element_text(size = 9),
          axis.text = element_text(size = 8),
          text = element_text(family = "arial")) +
    b + guides(fill = guide_legend(ncol = 3)) +
    theme(legend.position = "bottom",
          legend.key.size = unit(1, "lines"),
          legend.text = element_text(size = 8),
          legend.title = element_text(size = 9),
          plot.title = element_blank(),
          axis.title = element_text(size = 8),
          text = element_text(family = "arial")) +
    wrap_elements(c + theme(legend.position = "bottom", 
                            legend.key.size = unit(1, "lines"),
                            legend.text = element_text(size = 8),
                            legend.title = element_text(size = 9),
                            legend.box.just = 0,
                            legend.box = "horizontal",
                            plot.title = element_blank(),
                            axis.title = element_text(size = 8),
                            text = element_text(family = "arial"))) +
    wrap_elements(d + theme(plot.title = element_blank(),
                            legend.box = "horizontal",
                            legend.text = element_text(size = 7),
                            legend.key.size = unit(1, "lines"),
                            legend.title = element_text(size = 8),
                            axis.text.y = element_text(size = 7),
                            text = element_text(family = "arial"))) +
    wrap_elements(panel = e + theme(axis.text = element_text(size = 7),
                                    axis.title = element_text(size = 8)), 
                  clip = FALSE) +
    wrap_elements(panel = f + theme(axis.title = element_text(size = 9)), 
                  clip = FALSE) +
    plot_layout(design = layout) +
    plot_annotation(tag_levels = 'A') &
    theme(plot.tag = element_text(size = 14, face = "bold"))
`geom_smooth()` using method = 'loess' and formula 'y ~ x'
dev.off()
quartz_off_screen 
                2 

Supplementary Figure 15

a <- readRDS(here("output/figures/SFig-15A.rds"))
b <- readRDS(here("output/figures/SFig-15B.rds"))
c <- readRDS(here("output/figures/SFig-15C.rds"))

layout <- "
AAAA
BBBB
BBBB
CCCC
"        
cairo_pdf(here("output/figures/SFig-15.pdf"), width = 8, height = 10)
wrap_elements(a + theme(legend.position = "right",
                        plot.title = element_blank())) + 
    wrap_elements(shift_legend(b + theme(
        plot.title = element_blank()))) + 
    wrap_elements(c + theme(plot.title = element_blank())) +
    plot_layout(design = layout) +
    plot_annotation(tag_levels = 'A') &
    theme(plot.tag = element_text(size = 14, face = "bold"))
dev.off()
quartz_off_screen 
                2 

sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] UpSetR_1.4.0    ggplotify_0.0.5 forcats_0.5.1   stringr_1.4.0  
 [5] dplyr_1.0.5     purrr_0.3.4     readr_1.4.0     tidyr_1.1.3    
 [9] tibble_3.1.0    tidyverse_1.3.0 limma_3.46.0    ggplot2_3.3.3  
[13] patchwork_1.1.1 here_1.0.1      workflowr_1.6.2

loaded via a namespace (and not attached):
 [1] nlme_3.1-152        fs_1.5.0            lubridate_1.7.10   
 [4] RColorBrewer_1.1-2  httr_1.4.2          rprojroot_2.0.2    
 [7] tools_4.0.3         backports_1.2.1     bslib_0.2.4        
[10] utf8_1.2.1          R6_2.5.0            DBI_1.1.1          
[13] BiocGenerics_0.36.0 mgcv_1.8-34         colorspace_2.0-0   
[16] withr_2.4.1         tidyselect_1.1.0    gridExtra_2.3      
[19] compiler_4.0.3      git2r_0.28.0        cli_2.4.0          
[22] rvest_1.0.0         xml2_1.3.2          labeling_0.4.2     
[25] sass_0.3.1          scales_1.1.1        digest_0.6.27      
[28] rmarkdown_2.7       pkgconfig_2.0.3     htmltools_0.5.1.1  
[31] dbplyr_2.1.1        rlang_0.4.10        readxl_1.3.1       
[34] rstudioapi_0.13     gridGraphics_0.5-1  jquerylib_0.1.3    
[37] farver_2.1.0        generics_0.1.0      jsonlite_1.7.2     
[40] magrittr_2.0.1      Matrix_1.3-2        Rcpp_1.0.6         
[43] munsell_0.5.0       S4Vectors_0.28.1    fansi_0.4.2        
[46] lifecycle_1.0.0     stringi_1.5.3       whisker_0.4        
[49] yaml_2.2.1          plyr_1.8.6          grid_4.0.3         
[52] parallel_4.0.3      promises_1.2.0.1    crayon_1.4.1       
[55] lattice_0.20-41     cowplot_1.1.1       haven_2.3.1        
[58] splines_4.0.3       hms_1.0.0           knitr_1.31         
[61] pillar_1.5.1        stats4_4.0.3        reprex_2.0.0       
[64] glue_1.4.2          evaluate_0.14       BiocManager_1.30.12
[67] modelr_0.1.8        vctrs_0.3.7         httpuv_1.5.5       
[70] cellranger_1.1.0    gtable_0.3.0        assertthat_0.2.1   
[73] xfun_0.22           broom_0.7.6         later_1.1.0.1      
[76] lemon_0.4.5         rvcheck_0.1.8       IRanges_2.24.1     
[79] ellipsis_0.3.1