Last updated: 2020-06-23

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 e74e6e4. 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:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    analysis/figure/
    Ignored:    code/.job/
    Ignored:    code/old/
    Ignored:    data/
    Ignored:    output/FDR-analysis/
    Ignored:    output/Fig-1A.pdf
    Ignored:    output/Fig-1B.pdf
    Ignored:    output/Fig-1C.pdf
    Ignored:    output/Fig-1D.pdf
    Ignored:    output/Fig-3A.pdf
    Ignored:    output/Fig-3B.pdf
    Ignored:    output/Fig-3C.pdf
    Ignored:    output/Fig-3D.pdf
    Ignored:    output/Fig-4A.pdf
    Ignored:    output/Fig-4B.pdf
    Ignored:    output/Fig-4C-G.pdf
    Ignored:    output/SFig-1A.pdf
    Ignored:    output/SFig-1B.pdf
    Ignored:    output/SFig-3A.pdf
    Ignored:    output/SFig-3B.pdf
    Ignored:    output/SFig-4B.pdf
    Ignored:    output/SFig-5B.pdf
    Ignored:    output/SFig-6A.pdf
    Ignored:    output/SFig-6B-F.pdf
    Ignored:    output/SFig-7A.pdf
    Ignored:    output/SFig-7B-F.pdf
    Ignored:    output/SFig-8A.pdf
    Ignored:    output/SFig-8B-F.pdf
    Ignored:    output/SFig-X1.pdf
    Ignored:    output/SFig-X2.pdf
    Ignored:    output/compare-methods/
    Ignored:    output/methylgsa-params/
    Ignored:    output/random-cpg-sims/

Unstaged changes:
    Modified:   analysis/exploreArrayBias450.Rmd
    Modified:   analysis/fdrAnalysis.Rmd
    Modified:   code/utility.R

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/exploreData.Rmd) and HTML (docs/exploreData.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 e74e6e4 Jovana Maksimovic 2020-06-23 wflow_publish(c(“analysis/exploreData.Rmd”))
Rmd 823b793 Jovana Maksimovic 2020-06-16 UPdated analyses with label translation and new colour palette.
html 9cb4fea Jovana Maksimovic 2020-05-22 Build site.
Rmd 95e0882 Jovana Maksimovic 2020-05-22 wflow_publish(c(“analysis/runTimeComparison.Rmd”, “analysis/exploreData.Rmd”,
html 22f00e9 Jovana Maksimovic 2020-05-19 Build site.
Rmd 63b0011 Jovana Maksimovic 2020-05-19 wflow_publish(c(“analysis/exploreArrayBias450.Rmd”, “analysis/exploreArrayBiasEPIC.Rmd”,
html afc650b JovMaksimovic 2020-05-11 Build site.
Rmd 25e58bc JovMaksimovic 2020-05-11 Added BH to pdjust calls, added methylation vs expression plot.
Rmd cb5e0b1 JovMaksimovic 2020-05-08 Added delta M vs. log FC plot for methylation vs. RNAseq data for each contrast.
html da4f010 JovMaksimovic 2020-05-08 Build site.
Rmd c70ec78 JovMaksimovic 2020-05-08 wflow_publish(c(“analysis/expressionGenesets.Rmd”, “analysis/exploreData.Rmd”))
html 23cb749 JovMaksimovic 2020-04-28 Build site.
Rmd 81c97a7 JovMaksimovic 2020-04-28 wflow_publish(c(“analysis/expressionGenesets.Rmd”, “analysis/exploreData.Rmd”))
html d930b45 JovMaksimovic 2020-04-27 Build site.
Rmd bd39053 JovMaksimovic 2020-04-27 wflow_publish(c(“analysis/exploreData.Rmd”, “analysis/regionAnalysis.Rmd”))
html 06648a4 JovMaksimovic 2020-04-27 Build site.
Rmd 89af323 JovMaksimovic 2020-04-27 wflow_publish(c(“analysis/index.Rmd”, “analysis/exploreData.Rmd”,
html 8dc1e0f Jovana Maksimovic 2020-04-24 Build site.
Rmd f98b245 Jovana Maksimovic 2020-04-24 wflow_publish(“analysis/exploreData.Rmd”)
html caa373d Jovana Maksimovic 2020-04-24 Build site.
Rmd 9373b7c Jovana Maksimovic 2020-04-24 wflow_publish(“analysis/exploreData.Rmd”)
Rmd 3ae5062 Jovana Maksimovic 2020-04-21 Updated code to reverse bubble plot y-axis
html e82bc51 Jovana Maksimovic 2020-04-03 Build site.
Rmd f7696d6 Jovana Maksimovic 2020-04-03 wflow_publish(“analysis/exploreData.Rmd”)
html 76dacfc Jovana Maksimovic 2020-03-31 Build site.
Rmd 43ca6b6 Jovana Maksimovic 2020-03-31 wflow_publish(“analysis/exploreData.Rmd”)
Rmd 2bcb4c9 JovMaksimovic 2020-03-23 New script and modifications for methylGSA analysis.
Rmd 250d8ae JovMaksimovic 2020-03-16 Comitting local changes.
Rmd 24fb166 Jovana Maksimovic 2020-03-16 Adding Rmd file changes.
Rmd d7cd66e Jovana Maksimovic 2020-03-02 Initial Commit

library(here)
library(minfi)
library(paletteer)
library(limma)
library(BiocParallel)
library(reshape2)
library(gridExtra)
library(missMethyl)
library(ggplot2)
library(glue)
library(tidyverse)
library(rbin)
library(patchwork)
library(ChAMPdata)
source(here("code/utility.R"))

Load data

We are using publicly available EPIC data GSE110554 generated from flow sorted blood cells. The data is normalised and filtered (bad probes, multi-mapping probes, SNP probes, sex chromosomes).

# load data
dataFile <- here("data/GSE110554-data.RData")
if(file.exists(dataFile)){
    # load processed data and sample information
    load(dataFile)
} else {
    # get data from experiment hub, normalise, filter and save objects
    readData(dataFile)
    # load processed data and sample information
    load(dataFile)
}

QC plots

# plot mean detection p-values across all samples
dat <- tibble::tibble(mean = colMeans(detP), cellType = targets$CellType)
ggplot(dat, aes(y = mean, x = cellType, fill = cellType)) +
    geom_bar(stat = "identity") +
    labs(fill = "Cell Type") +
    scale_fill_brewer(palette = "Dark2")

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19
06648a4 JovMaksimovic 2020-04-27
76dacfc Jovana Maksimovic 2020-03-31
# plot normalised beta value distribution
bVals <- getBeta(normGr)
dat <- data.frame(reshape2::melt(bVals))
colnames(dat) <- c("cpg", "sample", "bVal")
dat <- dplyr::bind_cols(dat, cellType = rep(targets$CellType, 
                                            each = nrow(bVals)))

ggplot(dat, aes(x = bVal, colour = cellType)) +
    geom_density() +
    labs(colour = "Cell Type") +
    scale_color_brewer(palette = "Dark2")

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19
06648a4 JovMaksimovic 2020-04-27
76dacfc Jovana Maksimovic 2020-03-31

Figure 4A

View

# MDS plots to look at largest sources of variation
p <- plotMDS(getM(fltGr), top=1000, gene.selection="common", plot = FALSE)
dat <- tibble::tibble(x = p$x, y = p$y, cellType = targets$CellType)

p <- ggplot(dat, aes(x = x, y = y, colour = cellType)) +
    geom_point(size = 3) +
    labs(colour = "Cell type") +
    scale_colour_brewer(palette = "Dark2") +
    labs(x = "Principal component 1", y = "Principal component 2")
p

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19
da4f010 JovMaksimovic 2020-05-08

Create PDF

fig <- here("output/Fig-4A.pdf")

pdf(file = fig, width = 9)
p
dev.off()

MDS plots using only the CpGs that map to genes.

ann <- loadAnnotation("EPIC")
flatAnn <- missMethyl:::.getFlatAnnotation("EPIC", anno = ann)
geneM <- getM(fltGr[rownames(fltGr) %in% flatAnn$cpg,])

p <- plotMDS(geneM, top=1000, gene.selection="common", plot = FALSE)
dat <- tibble::tibble(x = p$x, y = p$y, cellType = targets$CellType)

ggplot(dat, aes(x = x, y = y, colour = cellType)) +
    geom_point(size = 3) +
    labs(colour = "Cell Type") +
    scale_colour_brewer(palette = "Dark2")

Version Author Date
da4f010 JovMaksimovic 2020-05-08
06648a4 JovMaksimovic 2020-04-27
76dacfc Jovana Maksimovic 2020-03-31

Statistical analysis

Compare several sets of sorted immune cells. Consider results significant at FDR < 0.05 and delta beta ~ 10% (~ lfc = 0.5).

mVals <- getM(fltGr)
bVals <- getBeta(fltGr)
design <- model.matrix(~0+targets$CellType)
colnames(design) <- levels(factor(targets$CellType))
fit <- lmFit(mVals, design)
cont.matrix <- makeContrasts(CD4vCD8=CD4T-CD8T,
                             #BcellvMono=Bcell-Mono,
                             MonovNeu=Mono-Neu,
                             BcellvNK=Bcell-NK,
                             #NeuvNK=Neu-NK,
                             #MonovNK=Mono-NK,
                             levels=design)
fit2 <- contrasts.fit(fit, cont.matrix)
tfit <- eBayes(fit2, robust=TRUE, trend=TRUE)
tfit <- treat(tfit, lfc = 0.5)
pval <- 0.05
fitSum <- summary(decideTests(tfit, p.value = pval))
fitSum
       CD4vCD8 MonovNeu BcellvNK
Down      5072     9324    34803
NotSig  725611   712480   667559
Up        3202    12081    31523

Figure 1B

View

tmp <- gometh(rownames(topTreat(tfit, coef = "CD4vCD8", num = 5000)), 
              anno = ann, array.type = "EPIC", plot.bias = TRUE)

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19
da4f010 JovMaksimovic 2020-05-08
06648a4 JovMaksimovic 2020-04-27
e82bc51 Jovana Maksimovic 2020-04-03
76dacfc Jovana Maksimovic 2020-03-31

Create PDF

fig <- here("output/Fig-1B.pdf")

pdf(file = fig, width = 9)
tmp <- gometh(rownames(topTreat(tfit, coef = "CD4vCD8", num = 5000)), 
              anno = ann, array.type = "EPIC", plot.bias = TRUE)
dev.off()

How correlated is differential methylation with differential expression for the same contrasts (same cell types but not identical samples)?

rfit <- readRDS(here("data/rnaseq-fit.rds"))
rdat <- rownames_to_column(data.frame(rfit$coefficients), var = "gene_id")

rdat %>% inner_join(data.frame(rfit$genes)) %>%
    mutate(entrezid = as.character(entrezid)) %>%
    dplyr::select(-length) -> rdat
rdat <- reshape2::melt(rdat, value.name = "coefficient")

reshape2::melt(rfit$p.value, value.name = "p.value") %>%
    group_by(Contrasts) %>%
    mutate(FDR = p.adjust(p.value, method = "BH")) -> rfdr

rdat %>% inner_join(rfdr, 
                    by = c("gene_id" = "Var1", "variable" = "Contrasts")) -> rdat

mdat <- rownames_to_column(data.frame(tfit$coefficients), var = "cpg")
mdat %>% inner_join(flatAnn) %>%
    dplyr::select(-symbol, -alias) -> mdat
mdat <- reshape2::melt(mdat, value.name = "coefficient") -> mdat

mdat %>% dplyr::select(-cpg) %>%
    mutate(promoter = ifelse(group %in% c("TSS1500", "TSS200", "1stExon"), 
                             "prom", "other")) %>%
    group_by(variable, entrezid, promoter) %>%
    #summarise(coef = coefficient[which.max(abs(coefficient))]) -> mdat
    summarise(coef = median(coefficient)) %>%
    dplyr::filter(promoter == "prom") -> mdat

mdat %>% inner_join(rdat, by = c("entrezid", "variable")) %>%
    mutate(colour = ifelse(FDR < 0.05, "Sig.", "Not sig.")) -> dat

ggplot(dat, aes(x = coef, y = coefficient, colour = colour)) +
    geom_point(data = dat[dat$colour == 'Not sig.',], alpha = 0.25, 
               size = 1) +
    geom_point(data = dat[dat$colour == 'Sig.',], size = 0.75, alpha = 0.5) +
    facet_wrap(vars(variable), ncol = 2, scales = "free") +
    labs(x = "Median logFC for CpGs in gene promoter", 
         y = "Gene expression Log FC", color = "Diff. Gene Exp.")

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19
afc650b JovMaksimovic 2020-05-11
da4f010 JovMaksimovic 2020-05-08
06648a4 JovMaksimovic 2020-04-27
76dacfc Jovana Maksimovic 2020-03-31

Supp. Figure X1

View

Examine only the independent contrasts.

dat <- melt(fitSum[rownames(fitSum) != "NotSig", ])
colnames(dat) <- c("dir","comp","num")

p <- ggplot(dat, aes(x = comp, y = num, fill = dir)) +
    geom_bar(stat = "identity", position = "dodge") +
    labs(x = "Comparison", y = "No. DM CpGs (FDR < 0.05)", fill = "Direction") +
    scale_fill_brewer(palette = "Set1", direction = -1)
p

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19
afc650b JovMaksimovic 2020-05-11
da4f010 JovMaksimovic 2020-05-08
06648a4 JovMaksimovic 2020-04-27
76dacfc Jovana Maksimovic 2020-03-31

Create PDF

fig <- here("output/SFig-X1.pdf")

pdf(file = fig, width = 9)
p
dev.off()

Compare performance of different gene set testing methods

Compare the gene set testing methods available for methylation arrays; hypergeometric test (HGT), gometh (best), methylRRA (GLM), methylRRA (ORA) and methylRRA (GSEA). As methylRRA does not work well with sets that only contain very few genes or very large sets, we will only test sets with at least 5 genes and maximum of 5000 genes.

Save analysis results

minsize <- 5
maxsize <- 5000

outFile <- here("data/blood.contrasts.rds")

if(!file.exists(outFile)){
  obj <- NULL
  obj$tfit <- tfit
  obj$maxsize <- maxsize
  obj$minsize <- minsize
  obj$mVals <- mVals
  obj$targets <- targets

  saveRDS(obj, file = outFile)

} 

Load output for all methods

inFiles <- list.files(here("output/compare-methods"), pattern = "rds", 
                      full.names = TRUE)

res <- lapply(inFiles, function(file){
    readRDS(file)
})

dat <- as_tibble(dplyr::bind_rows(res))
dat %>% filter(grepl("mmethyl", method)) %>%
    mutate(method = unname(dict[method])) -> subDat

ggplot(subDat, aes(x = pvalue, colour = sub)) +
    geom_density() +
    facet_grid(cols = vars(contrast), rows = vars(method)) +
    labs(colour = "Sig. CpG Selection", x = "P-value", y = "Density") +
    scale_color_hue(labels = c("Top 5000", "Top 10000", "FDR < 0.01", 
                                  "FDR < 0.05")) + 
    theme(legend.position = "bottom", legend.text = element_text(size=6))

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19
afc650b JovMaksimovic 2020-05-11
da4f010 JovMaksimovic 2020-05-08
06648a4 JovMaksimovic 2020-04-27
caa373d Jovana Maksimovic 2020-04-24
76dacfc Jovana Maksimovic 2020-03-31

Test GO categories

cpgEgGo <- cpgsEgGoFreqs(flatAnn)

Supp. Figure X2

View

cpgEgGo %>% 
  group_by(GO) %>%
  summarise(med = median(Freq)) -> medCpgEgGo

dat %>% filter(set == "GO") %>%
    filter(sub %in% c("n","c1")) %>% 
    mutate(method = unname(dict[method])) %>% 
    inner_join(medCpgEgGo, by = c("ID" = "GO")) -> sub

bins <- rbin_quantiles(sub, ID, med, bins = 12)
sub$bin <- as.factor(findInterval(sub$med, bins$upper_cut))

binLabs <- paste0("<", bins$upper_cut)
names(binLabs) <- levels(sub$bin)
binLabs[length(binLabs)] <- gsub("<", "\u2265", binLabs[length(binLabs) - 1])
    
sub %>% group_by(contrast, method, bin) %>%
  summarise(prop = sum(pvalue < 0.05)/n()) -> pdat

p <- ggplot(pdat, aes(x = as.numeric(bin), y = prop, color = method)) +
  geom_line(size = 1.25) +
  facet_wrap(vars(contrast), ncol = 3) +
  scale_x_continuous(breaks = as.numeric(levels(pdat$bin)), labels = binLabs) +
  theme(axis.text.x = element_text(angle=45, hjust = 1, vjust = 1,
                                   size = 7),
        legend.position = "bottom") +
  labs(x = "Med. No. CpGs per Gene per GO Cat. (binned)",
       y = "Prop. GO Cat. with p-value < 0.05",
       colour = "Method") +
    scale_color_manual(values = methodCols)
p

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19
afc650b JovMaksimovic 2020-05-11
da4f010 JovMaksimovic 2020-05-08
06648a4 JovMaksimovic 2020-04-27
caa373d Jovana Maksimovic 2020-04-24
76dacfc Jovana Maksimovic 2020-03-31

Create PDF

fig <- here("output/SFig-X2.pdf")

pdf(file = fig, width = 9)
p
dev.off()

As we are comparing immune cells, we expect GO categories related to the immune system and its processes to be highly ranked. To evalue this, we downloaded all of the child terms for the GO category “immune system process” (GO:002376) from AminGO 2; http://amigo.geneontology.org/amigo/term/GO:0002376.

immuneGO <- unique(read.csv(here("data/GO-immune-system-process.txt"),
                            stringsAsFactors = FALSE, header = FALSE,
                            col.names = "GOID"))

dat %>% filter(set == "GO") %>%
    filter(sub %in% c("n","c1")) %>% 
    mutate(method = unname(dict[method])) %>% 
    arrange(contrast, method, pvalue) %>%
    group_by(contrast, method) %>%
    mutate(csum = cumsum(ID %in% immuneGO$GOID)) %>% 
    mutate(rank = 1:n()) %>%
    filter(rank <= 100) -> sub

p <- ggplot(sub, aes(x = rank, y = csum, colour = method)) +
    geom_line() +
    facet_wrap(vars(contrast), ncol=3) +
    geom_vline(xintercept = 10, linetype = "dotted") +
    labs(colour = "Method", x = "Rank", y = "Cumulative no. immune sets") +
    theme(legend.position = "bottom") +
    scale_color_manual(values = methodCols)
p

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19
afc650b JovMaksimovic 2020-05-11
da4f010 JovMaksimovic 2020-05-08
06648a4 JovMaksimovic 2020-04-27
caa373d Jovana Maksimovic 2020-04-24

Examine results when top ranked 100 GO terms from RNA-seq analysis of the same cell type comparisons is used as “truth”.

rnaseqGO <- readRDS(here("data/RNAseq-GO.rds"))
rnaseqGO %>% group_by(contrast) %>%
    mutate(rank = 1:n()) %>%
    filter(rank <= 100) -> topGOSets
    
dat %>% filter(set == "GO") %>%
    filter(sub %in% c("n","c1")) %>% 
    mutate(method = unname(dict[method])) %>% 
    arrange(contrast, method, pvalue) %>%
    group_by(contrast, method) %>%
    mutate(csum = cumsum(ID %in% topGOSets$ID[topGOSets$contrast %in% contrast])) %>%
    mutate(rank = 1:n()) %>%
    filter(rank <= 100) -> sub

p <- ggplot(sub, aes(x = rank, y = csum, colour = method)) +
    geom_line() +
    facet_wrap(vars(contrast), ncol=3) +
    geom_vline(xintercept = 10, linetype = "dotted") +
    labs(colou = "Method", x = "Rank", 
         y = glue("Cumulative no. RNAseq sets")) +
    theme(legend.position = "bottom") +
    scale_color_manual(values = methodCols)
p

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19
afc650b JovMaksimovic 2020-05-11
da4f010 JovMaksimovic 2020-05-08
23cb749 JovMaksimovic 2020-04-28
06648a4 JovMaksimovic 2020-04-27
caa373d Jovana Maksimovic 2020-04-24

Figure 4B, Supp. Figure 4B, Supp. Figure 5B

View

p <- vector("list", length(unique(dat$contrast)))

for(i in 1:length(unique(dat$contrast))){
    cont <- sort(unique(dat$contrast))[i]
    
    dat %>% filter(set == "GO") %>%
        filter(sub %in% c("n","c1")) %>%
        filter(contrast == cont) %>%
        mutate(method = unname(dict[method])) %>% 
        arrange(method, pvalue) %>%
        group_by(method) %>%
        mutate(rank = 1:n()) %>%
        filter(rank <= 100) %>%
        summarise(prop = sum(ID %in% immuneGO$GOID)/n()) %>%
        mutate(truth = "ISP Terms") -> immuneSum
    
    dat %>% filter(set == "GO") %>%
        filter(sub %in% c("n","c1")) %>%
        filter(contrast == cont) %>%
        mutate(method = unname(dict[method])) %>% 
        arrange(method, pvalue) %>%
        group_by(method) %>%
        mutate(rank = 1:n()) %>%
        filter(rank <= 100) %>%
        summarise(prop = sum(ID %in% topGOSets$ID[topGOSets$contrast %in% 
                                                      cont])/n()) %>%
        mutate(truth = "RNAseq Terms") -> rnaseqSum
    
    truthSum <- bind_rows(immuneSum, rnaseqSum)
    
    p[[i]] <- ggplot(truthSum, aes(x = truth, y = prop, fill = method)) + 
        geom_bar(stat = "identity", position = "dodge") +
        labs(fill = "Method", 
             x = "Truth set", 
             y = "Prop. 'truth' terms in top 100") +
        scale_fill_manual(values = methodCols) +
        ggtitle(cont)
}

p[[1]]

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19
afc650b JovMaksimovic 2020-05-11
da4f010 JovMaksimovic 2020-05-08
06648a4 JovMaksimovic 2020-04-27
caa373d Jovana Maksimovic 2020-04-24
p[[2]]

p[[3]]

Create PDF

fig <- here("output/Fig-4B.pdf")

pdf(file = fig, width = 9)
p[[1]]
dev.off()

fig <- here("output/SFig-4B.pdf")

pdf(file = fig, width = 9)
p[[2]]
dev.off()

fig <- here("output/SFig-5B.pdf")

pdf(file = fig, width = 9)
p[[3]]
dev.off()

Figure 4C-G, Supp. Figure 4C-G, Supp Figure 5C-G

View

Examine what the top 10 ranked gene sets are and how many genes they contain, for each method and comparison.

terms <- missMethyl:::.getGO()$idTable
nGenes <- rownames_to_column(data.frame(n = sapply(missMethyl:::.getGO()$idList, 
                                                   length)), 
                             var = "ID")

dat %>% filter(set == "GO") %>%
    filter(sub %in% c("n","c1")) %>% 
    mutate(method = unname(dict[method])) %>% 
    arrange(contrast, method, pvalue) %>%
    group_by(contrast, method) %>%
    mutate(FDR = p.adjust(pvalue, method = "BH")) %>%
    mutate(rank = 1:n()) %>%
    filter(rank <= 10) %>% 
    inner_join(terms, by = c("ID" = "GOID")) %>%
    inner_join(nGenes) -> sub
Joining, by = "ID"
p <- vector("list", length(unique(sub$contrast)))
for(i in 1:length(unique(sub$contrast))){
    cont <- sort(unique(sub$contrast))[i]
    sub %>% filter(contrast == cont) %>%
        arrange(method, -rank) %>%
        ungroup() %>%
        mutate(idx = as.factor(1:n())) -> tmp
    
    ord <- unlist(lapply(1:length(unique(tmp$method)), function(i){
        c((i*10):(i*10-9))
    }))
    termLabs <- substr(tmp$TERM[ord], 1, 50)
    names(termLabs) <- tmp$idx[ord]
    
    rnaTruth <- tmp$ID[ord] %in% topGOSets$ID[topGOSets$contrast %in% cont]
    ispTruth <- tmp$ID[ord] %in% immuneGO$GOID
    sumTruth <- rnaTruth + ispTruth
    
    truthCol <- ifelse(sumTruth == 2, "purple", 
                       ifelse(sumTruth == 1 & rnaTruth == 1, "red",
                              ifelse(sumTruth == 1 & ispTruth == 1, "blue", 
                                     "black")))
        
    p[[i]] <- ggplot(tmp, aes(x = -log10(FDR), y = idx)) +
        geom_point(aes(size = n), alpha = 0.8, 
                   colour = methodCols[tmp$method]) +
        scale_size(limits = c(min(sub$n), max(sub$n))) +
        facet_wrap(vars(method), ncol = 2, scales = "free") +
        scale_y_discrete(labels = termLabs) +
        labs(y = "", size = "No. genes") +
        theme(axis.text.y = element_text(size = 8),
              plot.title = element_text(size = 10),
              legend.position = "bottom",
              legend.text = element_text(size = 8),
              legend.title = element_text(size = 10),
              axis.text.x = element_text(size = 8),
              axis.title.x = element_text(size = 10)) +
        geom_vline(xintercept = -log10(0.05), linetype = "dashed") +
        ggtitle(cont)  
}

p[[1]]

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19
afc650b JovMaksimovic 2020-05-11
da4f010 JovMaksimovic 2020-05-08
p[[2]]

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19
afc650b JovMaksimovic 2020-05-11
p[[3]]

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19
afc650b JovMaksimovic 2020-05-11

Create PDF

fig <- here("output/Fig-4C-G.pdf")

pdf(file = fig, width = 9)
p[[1]]
dev.off()

fig <- here("output/SFig-4C-G.pdf")

pdf(file = fig, width = 9)
p[[2]]
dev.off()

fig <- here("output/SFig-5C-G.pdf")

pdf(file = fig, width = 9)
p[[3]]
dev.off()

P-value histograms for the different methods for all contrasts on GO categories.

dat %>% filter(set == "GO") %>%
    filter(sub %in% c("n","c1")) %>%
    mutate(method = unname(dict[method])) -> subDat 
    
ggplot(subDat, aes(pvalue, fill = method)) +
    geom_histogram(binwidth = 0.025) +
    facet_grid(cols = vars(contrast), rows = vars(method)) +
    theme(legend.position = "bottom") +
    labs(x = "P-value", y = "Frequency", fill = "Method") +
    scale_fill_manual(values = methodCols)

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19

Compare gometh results using different DM CpG significance cutoffs

dat %>% filter(set == "GO") %>%
    filter(grepl("mmethyl", method)) %>%
    mutate(method = unname(dict[method])) %>%
    arrange(contrast, method, pvalue) %>%
    group_by(contrast, method, sub) %>%
    mutate(csum = cumsum(ID %in% immuneGO$GOID)) %>% 
    mutate(rank = 1:n()) %>%
    mutate(cut = ifelse(sub == "c1", "Top 5000", 
                        ifelse(sub == "c2", "Top 10000",
                               ifelse(sub == "p1", "FDR < 0.01", "FDR < 0.05")))) %>%
    filter(rank <= 100) -> sub

p <- ggplot(sub, aes(x = rank, y = csum, colour = cut)) +
    geom_line() +
    facet_wrap(vars(contrast, method), ncol=2, nrow = 3, scales = "free") +
    geom_vline(xintercept = 10, linetype = "dotted") +
    labs(colour = "Sig. select", x = "Rank", y = "Cumulative no. immune sets") +
    theme(legend.position = "bottom")
p

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19
dat %>% filter(set == "GO") %>%
    filter(grepl("mmethyl", method)) %>%
    mutate(method = unname(dict[method])) %>%
    arrange(contrast, method, pvalue) %>%
    group_by(contrast, method, sub) %>%
    mutate(csum = cumsum(ID %in% topGOSets$ID[topGOSets$contrast %in% 
                                                  contrast])) %>%
    mutate(rank = 1:n()) %>%
    mutate(cut = ifelse(sub == "c1", "Top 5000", 
                        ifelse(sub == "c2", "Top 10000",
                               ifelse(sub == "p1", "FDR < 0.01", "FDR < 0.05")))) %>%
    filter(rank <= 100) -> sub

p <- ggplot(sub, aes(x = rank, y = csum, colour = cut)) +
    geom_line() +
    facet_wrap(vars(contrast, method), ncol=2, nrow = 3, scales = "free") +
    geom_vline(xintercept = 10, linetype = "dotted") +
    labs(colour = "Sig. select", x = "Rank", 
         y = glue("Cumulative no. RNAseq sets")) +
    theme(legend.position = "bottom")
p

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19

Test KEGG pathways

Now test KEGG pathways with at least 5 genes and 5000 at most.

Again, as we are comparing immune cells we expecte pathways from the following categories to be highly ranked: Immune system, Immune disease, Signal transduction, Signaling molecules and interaction; https://www.genome.jp/kegg/pathway.html.

immuneKEGG <- read.csv(here("data/kegg-immune-related-pathways.csv"), 
                            stringsAsFactors = FALSE, header = FALSE, 
                            col.names = c("ID","pathway"))
immuneKEGG$PID <- paste0("path:hsa0",immuneKEGG$ID)

dat %>% filter(set == "KEGG") %>%
    filter(sub %in% c("n","c1")) %>% 
    mutate(method = unname(dict[method])) %>%
    arrange(contrast, method, pvalue) %>%
    group_by(contrast, method) %>%
    mutate(csum = cumsum(ID %in% immuneKEGG$PID)) %>%
    mutate(rank = 1:n()) %>%
    filter(rank <= 100) -> sub

p <- ggplot(sub, aes(x = rank, y = csum, colour = method)) +
    geom_line() +
    facet_wrap(vars(contrast), ncol=3) +
    geom_vline(xintercept = 10, linetype = "dotted") +
    labs(colour = "Method", x = "Rank", y = "Cumulative no. immune sets") +
    theme(legend.position = "bottom") +
    scale_color_manual(values = methodCols)
p

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19

Examine results when top ranked 100 KEGG pathways from RNA-seq analysis of the same cell type comparisons is used as “truth”.

rnaseqKEGG <- readRDS(here("data/RNAseq-KEGG.rds"))
rnaseqKEGG %>% group_by(contrast) %>%
    mutate(rank = 1:n()) %>%
    filter(rank <= 100) -> topKEGG

dat %>% filter(set == "KEGG") %>%
    filter(sub %in% c("n","c1")) %>%
    mutate(method = unname(dict[method])) %>%
    arrange(contrast, method, pvalue) %>%
    group_by(contrast, method) %>%
    mutate(csum = cumsum(ID %in% topKEGG$PID[topKEGG$contrast %in% contrast])) %>%
    mutate(rank = 1:n()) %>%
    filter(rank <= 100) -> sub

p <- ggplot(sub, aes(x = rank, y = csum, colour = method)) +
    geom_line() +
    facet_wrap(vars(contrast), ncol=3, scales = "free_y") +
    geom_vline(xintercept = 10, linetype = "dotted") +
    labs(colour = "Method", x = "Rank", y = "Cumulative no. RNAseq sets") +
    theme(legend.position = "bottom") + 
    scale_color_manual(values = methodCols)
p

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19

Examine what the top 10 ranked gene sets are and how many genes they contain, for each method and comparison.

terms <- missMethyl:::.getKEGG()$idTable
nGenes <- rownames_to_column(data.frame(n = sapply(missMethyl:::.getKEGG()$idList, 
                                                   length)), 
                             var = "ID")

dat %>% filter(set == "KEGG") %>%
    filter(sub %in% c("n","c1")) %>% 
    mutate(method = unname(dict[method])) %>%
    arrange(contrast, method, pvalue) %>%
    group_by(contrast, method) %>%
    mutate(FDR = p.adjust(pvalue, method = "BH")) %>%
    mutate(rank = 1:n()) %>%
    filter(rank <= 10) %>% 
    inner_join(terms, by = c("ID" = "PathwayID")) %>%
    inner_join(nGenes) -> sub
Joining, by = "ID"
p <- vector("list", length(unique(sub$contrast)))
for(i in 1:length(unique(sub$contrast))){
    cont <- unique(sub$contrast)[i]
    sub %>% filter(contrast == cont) %>%
        arrange(method, -rank) %>%
        ungroup() %>%
        mutate(idx = as.factor(1:n())) -> tmp
    
    ord <- unlist(lapply(1:length(unique(tmp$method)), function(i){
        c((i*10):(i*10-9))
    }))
    termLabs <- substr(tmp$Description[ord], 1, 50)
    names(termLabs) <- tmp$idx[ord]
    
    p[[i]] <- ggplot(tmp, aes(x = -log10(FDR), y = idx)) +
        geom_point(aes(size = n), alpha = 0.8, colour = methodCols[tmp$method]) +
        facet_wrap(vars(method), ncol = 2, scales = "free") +
        scale_y_discrete(labels = termLabs) +
        labs(y = "", size = "No. genes") +
        theme(axis.text.y = element_text(size = 8),
              plot.title = element_text(size = 10),
              legend.position = "bottom",
              legend.text = element_text(size = 8),
              legend.title = element_text(size = 10),
              axis.text.x = element_text(size = 8),
              axis.title.x = element_text(size = 10)) +
        geom_vline(xintercept = -log10(0.05), linetype = "dashed") +
        ggtitle(cont)  
}

p[[1]]

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19
p[[2]]

p[[3]]

P-value histograms for the different methods for all contrasts on KEGG pathways.

dat %>% filter(set == "KEGG") %>%
    filter(sub %in% c("n","c1")) %>%
    mutate(method = unname(dict[method])) -> subDat 
    
ggplot(subDat, aes(pvalue, fill = method)) +
    geom_histogram(binwidth = 0.025) +
    facet_grid(cols = vars(contrast), rows = vars(method)) +
    theme(legend.position = "bottom") +
    labs(x = "P-value", y = "Frequency", fill = "Method") +
    scale_fill_manual(values = methodCols)

Version Author Date
22f00e9 Jovana Maksimovic 2020-05-19

Compare gometh results using different DM CpG significance cutoffs

dat %>% filter(set == "KEGG") %>%
    filter(grepl("mmethyl", method)) %>% 
    mutate(method = unname(dict[method])) %>%
    arrange(contrast, method, pvalue) %>%
    group_by(contrast, method, sub) %>%
    mutate(csum = cumsum(ID %in% immuneKEGG$PID)) %>% 
    mutate(rank = 1:n()) %>%
    mutate(cut = ifelse(sub == "c1", "Top 5000", 
                        ifelse(sub == "c2", "Top 10000",
                               ifelse(sub == "p1", "FDR < 0.01", "FDR < 0.05")))) %>%
    filter(rank <= 100) -> sub

p <- ggplot(sub, aes(x = rank, y = csum, colour = cut)) +
    geom_line() +
    facet_wrap(vars(contrast, method), ncol=2, nrow = 3, scales = "free") +
    geom_vline(xintercept = 10, linetype = "dotted") +
    labs(colour = "Sig. select", x = "Rank", y = "Cumulative no. immune sets") +
    theme(legend.position = "bottom")
p

dat %>% filter(set == "KEGG") %>%
    filter(grepl("mmethyl", method)) %>% 
    mutate(method = unname(dict[method])) %>%
    arrange(contrast, method, pvalue) %>%
    group_by(contrast, method, sub) %>%
    mutate(csum = cumsum(ID %in% topKEGG$PID[topKEGG$contrast %in% contrast])) %>%
    mutate(rank = 1:n()) %>%
    mutate(cut = ifelse(sub == "c1", "Top 5000", 
                        ifelse(sub == "c2", "Top 10000",
                               ifelse(sub == "p1", "FDR < 0.01", "FDR < 0.05")))) %>%
    filter(rank <= 100) -> sub

p <- ggplot(sub, aes(x = rank, y = csum, colour = cut)) +
    geom_line() +
    facet_wrap(vars(contrast, method), ncol=2, nrow = 3, scales = "free") +
    geom_vline(xintercept = 10, linetype = "dotted") +
    labs(colour = "Sig. select", x = "Rank", 
         y = glue("Cumulative no. RNAseq sets")) +
    theme(legend.position = "bottom")
p

Test BROAD gene sets

As the ebGSEA method from the ChAMP package only allows testing of their in-built database of Broad Institute gene sets, we will compare to other methods by testing these same gene sets. Using the top 100 ranked gene sets as identified by Belinda’s gsaseq analysis of the corresponding RNAseq data as “truth”.

rnaseqBROAD <- readRDS(here("data/RNAseq-BROAD-GSA.rds"))
rnaseqBROAD %>% group_by(contrast) %>%
    mutate(rank = 1:n()) %>%
    filter(rank <= 100) -> topBROAD

dat %>% filter(set == "BROAD") %>%
    filter(sub %in% c("n","c1")) %>% 
    mutate(method = unname(dict[method])) %>% 
    arrange(contrast, method, pvalue) %>%
    group_by(contrast, method) %>%
    mutate(csum = cumsum(ID %in% topBROAD$ID[topBROAD$contrast %in% contrast])) %>%
    mutate(rank = 1:n()) %>%
    filter(rank <= 100) -> sub

p <- ggplot(sub, aes(x = rank, y = csum, colour = method)) +
    geom_line() +
    facet_wrap(vars(contrast), ncol=3, scales = "free_y") +
    geom_vline(xintercept = 10, linetype = "dotted") +
    labs(colour = "Method", x = "Rank", y = "Cumulative no. RNAseq sets") +
    theme(legend.position = "bottom") +
    scale_color_manual(values = methodCols)
p

Supp. Figure 6A, Supp. Figure 7A, Supp. Figure 8A

View

p <- vector("list", length(unique(dat$contrast)))

for(i in 1:length(unique(dat$contrast))){
    cont <- sort(unique(dat$contrast))[i]
    
    dat %>% filter(set == "BROAD") %>%
        filter(sub %in% c("n","c1")) %>%
        filter(contrast == cont) %>%
        mutate(method = unname(dict[method])) %>% 
        arrange(method, pvalue) %>%
        group_by(method) %>%
        mutate(rank = 1:n()) %>%
        filter(rank <= 100) %>%
        summarise(prop = sum(ID %in% topBROAD$ID[topBROAD$contrast %in% cont])/n()) %>%
        mutate(truth = "RNAseq Terms") -> rnaseqSum
    
    p[[i]] <- ggplot(rnaseqSum, aes(x = truth, y = prop, fill = method)) + 
        geom_bar(stat = "identity", position = "dodge") +
        labs(fill = "Method", 
             x = "Truth set", 
             y = "Prop. 'truth' terms in top 100") +
        scale_fill_manual(values = methodCols) +
        ggtitle(cont)
}

p[[1]]

p[[2]]

p[[3]]

Create PDF

fig <- here("output/SFig-6A.pdf")

pdf(file = fig, width = 9)
p[[1]]
dev.off()

fig <- here("output/SFig-7A.pdf")

pdf(file = fig, width = 9)
p[[2]]
dev.off()

fig <- here("output/SFig-8A.pdf")

pdf(file = fig, width = 9)
p[[3]]
dev.off()

Supp Figure 6B-F, 7B-F, 8B-F

View

data(PathwayList)
nGenes <- rownames_to_column(data.frame(n = sapply(PathwayList, 
                                                   length)), 
                             var = "ID")

dat %>% filter(set == "BROAD") %>%
    filter(sub %in% c("n","c1")) %>% 
    mutate(method = unname(dict[method])) %>% 
    arrange(contrast, method, pvalue) %>%
    group_by(contrast, method) %>%
    mutate(FDR = p.adjust(pvalue, method = "BH")) %>%
    mutate(rank = 1:n()) %>%
    filter(rank <= 10) %>% 
    inner_join(nGenes) -> sub
Joining, by = "ID"
p <- vector("list", length(unique(sub$contrast)))
for(i in 1:length(unique(sub$contrast))){
    cont <- sort(unique(sub$contrast))[i]
    sub %>% filter(contrast == cont) %>%
        arrange(method, -rank) %>%
        ungroup() %>%
        mutate(idx = as.factor(1:n())) -> tmp
    
    ord <- unlist(lapply(1:length(unique(tmp$method)), function(i){
        c((i*10):(i*10-9))
    }))
    termLabs <- substr(tmp$ID[ord], 1, 50)
    names(termLabs) <- tmp$idx[ord]
    
    truthCol <- ifelse(termLabs %in% topBROAD$ID[topBROAD$contrast %in% cont]
                       [1:100], "red", "black")
    
    p[[i]] <- ggplot(tmp, aes(x = -log10(FDR), y = idx)) +
        geom_point(aes(size = n), alpha = 0.8, colour = methodCols[tmp$method]) +
        facet_wrap(vars(method), ncol = 2, scales = "free") +
        scale_y_discrete(labels = termLabs) +
        labs(y = "", size = "No. genes") +
        theme(axis.text.y = element_text(size = 6, colour = truthCol),
              plot.title = element_text(size = 10),
              legend.position = "bottom",
              legend.text = element_text(size = 8),
              legend.title = element_text(size = 10),
              axis.text.x = element_text(size = 8),
              axis.title.x = element_text(size = 10)) +
        geom_vline(xintercept = -log10(0.05), linetype = "dashed") +
        ggtitle(cont)  
}
Warning: Vectorized input to `element_text()` is not officially supported.
Results may be unexpected or may change in future versions of ggplot2.

Warning: Vectorized input to `element_text()` is not officially supported.
Results may be unexpected or may change in future versions of ggplot2.

Warning: Vectorized input to `element_text()` is not officially supported.
Results may be unexpected or may change in future versions of ggplot2.
p[[1]]

p[[2]]

p[[3]]

Create PDF

fig <- here("output/SFig-6B-F.pdf")

pdf(file = fig, width = 9)
p[[1]]
dev.off()

fig <- here("output/SFig-7B-F.pdf")

pdf(file = fig, width = 9)
p[[2]]
dev.off()

fig <- here("output/SFig-8B-F.pdf")

pdf(file = fig, width = 9)
p[[3]]
dev.off()

P-value histograms for the different methods for all contrasts on BROAD gene sets.

dat %>% filter(set == "BROAD") %>%
    filter(sub %in% c("n","c1")) %>%
    mutate(method = unname(dict[method])) -> subDat 
    
ggplot(subDat, aes(pvalue, fill = method)) +
    geom_histogram(binwidth = 0.025) +
    facet_grid(cols = vars(contrast), rows = vars(method)) +
    theme(legend.position = "bottom") +
    labs(x = "P-value", y = "Frequency", fill = "Method") +
    scale_fill_manual(values = methodCols)

Compare gometh results using different DM CpG significance cutoffs

dat %>% filter(set == "BROAD") %>%
    filter(grepl("mmethyl", method)) %>% 
    mutate(method = unname(dict[method])) %>%
    arrange(contrast, method, pvalue) %>%
    group_by(contrast, method, sub) %>%
    mutate(csum = cumsum(ID %in% topBROAD$ID)) %>% 
    mutate(rank = 1:n()) %>%
    mutate(cut = ifelse(sub == "c1", "Top 5000", 
                        ifelse(sub == "c2", "Top 10000",
                               ifelse(sub == "p1", "FDR < 0.01", "FDR < 0.05")))) %>%
    filter(rank <= 100) -> sub

p <- ggplot(sub, aes(x = rank, y = csum, colour = cut)) +
    geom_line() +
    facet_wrap(vars(contrast, method), ncol=2, nrow = 3, scales = "free") +
    geom_vline(xintercept = 10, linetype = "dotted") +
    labs(colour = "Sig. select", x = "Rank", y = "Cumulative no. immune sets") +
    theme(legend.position = "bottom")
p

dat %>% filter(set == "BROAD") %>%
    filter(grepl("mmethyl", method)) %>% 
    mutate(method = unname(dict[method])) %>%
    arrange(contrast, method, pvalue) %>%
    group_by(contrast, method, sub) %>%
    mutate(csum = cumsum(ID %in% topBROAD$ID)) %>% 
    mutate(rank = 1:n()) %>%
    mutate(cut = ifelse(sub == "c1", "Top 5000", 
                        ifelse(sub == "c2", "Top 10000",
                               ifelse(sub == "p1", "FDR < 0.01", "FDR < 0.05")))) %>%
    filter(rank <= 100) -> sub

p <- ggplot(sub, aes(x = rank, y = csum, colour = cut)) +
    geom_line() +
    facet_wrap(vars(contrast, method), ncol=2, nrow = 3, scales = "free") +
    geom_vline(xintercept = 10, linetype = "dotted") +
    labs(colour = "Sig. select", x = "Rank", y = "Cumulative no. immune sets") +
    theme(legend.position = "bottom")
p


sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS:   /config/RStudio/R/3.6.1/lib64/R/lib/libRblas.so
LAPACK: /config/RStudio/R/3.6.1/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8    
 [5] LC_MONETARY=en_AU.UTF-8    LC_MESSAGES=en_AU.UTF-8   
 [7] LC_PAPER=en_AU.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] ChAMPdata_2.18.0            patchwork_1.0.0            
 [3] rbin_0.2.0                  forcats_0.4.0              
 [5] stringr_1.4.0               dplyr_0.8.5                
 [7] purrr_0.3.4                 readr_1.3.1                
 [9] tidyr_1.1.0                 tibble_3.0.1               
[11] tidyverse_1.3.0             glue_1.4.1                 
[13] ggplot2_3.3.0               missMethyl_1.20.4          
[15] gridExtra_2.3               reshape2_1.4.3             
[17] limma_3.42.2                paletteer_1.1.0            
[19] minfi_1.32.0                bumphunter_1.26.0          
[21] locfit_1.5-9.1              iterators_1.0.12           
[23] foreach_1.5.0               Biostrings_2.54.0          
[25] XVector_0.24.0              SummarizedExperiment_1.16.1
[27] DelayedArray_0.12.3         BiocParallel_1.20.1        
[29] matrixStats_0.56.0          Biobase_2.46.0             
[31] GenomicRanges_1.38.0        GenomeInfoDb_1.22.1        
[33] IRanges_2.20.2              S4Vectors_0.24.4           
[35] BiocGenerics_0.32.0         here_0.1                   
[37] workflowr_1.6.2            

loaded via a namespace (and not attached):
  [1] tidyselect_1.1.0                                   
  [2] RSQLite_2.1.2                                      
  [3] AnnotationDbi_1.46.1                               
  [4] grid_3.6.1                                         
  [5] munsell_0.5.0                                      
  [6] codetools_0.2-16                                   
  [7] preprocessCore_1.48.0                              
  [8] statmod_1.4.32                                     
  [9] withr_2.2.0                                        
 [10] colorspace_1.4-1                                   
 [11] knitr_1.28                                         
 [12] rstudioapi_0.11                                    
 [13] labeling_0.3                                       
 [14] git2r_0.27.1                                       
 [15] GenomeInfoDbData_1.2.1                             
 [16] farver_2.0.3                                       
 [17] bit64_0.9-7                                        
 [18] rhdf5_2.30.1                                       
 [19] rprojroot_1.3-2                                    
 [20] vctrs_0.3.0                                        
 [21] generics_0.0.2                                     
 [22] xfun_0.14                                          
 [23] BiocFileCache_1.10.2                               
 [24] R6_2.4.1                                           
 [25] illuminaio_0.28.0                                  
 [26] palr_0.2.0                                         
 [27] pals_1.6                                           
 [28] bitops_1.0-6                                       
 [29] reshape_0.8.8                                      
 [30] assertthat_0.2.1                                   
 [31] promises_1.1.0                                     
 [32] IlluminaHumanMethylation450kanno.ilmn12.hg19_0.6.0 
 [33] scales_1.1.1                                       
 [34] gtable_0.3.0                                       
 [35] methylumi_2.30.0                                   
 [36] rlang_0.4.6                                        
 [37] genefilter_1.68.0                                  
 [38] splines_3.6.1                                      
 [39] rtracklayer_1.44.4                                 
 [40] GEOquery_2.54.1                                    
 [41] dichromat_2.0-0                                    
 [42] broom_0.5.2                                        
 [43] scico_1.1.0                                        
 [44] yaml_2.2.1                                         
 [45] modelr_0.1.8                                       
 [46] GenomicFeatures_1.36.4                             
 [47] backports_1.1.7                                    
 [48] httpuv_1.5.2                                       
 [49] tools_3.6.1                                        
 [50] nor1mix_1.3-0                                      
 [51] ellipsis_0.3.1                                     
 [52] RColorBrewer_1.1-2                                 
 [53] siggenes_1.60.0                                    
 [54] Rcpp_1.0.4.6                                       
 [55] plyr_1.8.6                                         
 [56] progress_1.2.2                                     
 [57] zlibbioc_1.30.0                                    
 [58] RCurl_1.95-4.12                                    
 [59] BiasedUrn_1.07                                     
 [60] prettyunits_1.1.1                                  
 [61] openssl_1.4.1                                      
 [62] IlluminaHumanMethylationEPICmanifest_0.3.0         
 [63] haven_2.2.0                                        
 [64] cluster_2.1.0                                      
 [65] fs_1.4.1                                           
 [66] magrittr_1.5                                       
 [67] data.table_1.12.8                                  
 [68] reprex_0.3.0                                       
 [69] whisker_0.4                                        
 [70] IlluminaHumanMethylationEPICanno.ilm10b4.hg19_0.6.0
 [71] hms_0.5.3                                          
 [72] evaluate_0.14                                      
 [73] xtable_1.8-4                                       
 [74] XML_3.98-1.20                                      
 [75] mclust_5.4.6                                       
 [76] readxl_1.3.1                                       
 [77] compiler_3.6.1                                     
 [78] biomaRt_2.42.1                                     
 [79] maps_3.3.0                                         
 [80] crayon_1.3.4                                       
 [81] htmltools_0.4.0                                    
 [82] later_1.0.0                                        
 [83] jcolors_0.0.4                                      
 [84] lubridate_1.7.4                                    
 [85] DBI_1.0.0                                          
 [86] dbplyr_1.4.2                                       
 [87] MASS_7.3-51.6                                      
 [88] rappdirs_0.3.1                                     
 [89] Matrix_1.2-18                                      
 [90] cli_2.0.2                                          
 [91] quadprog_1.5-8                                     
 [92] pkgconfig_2.0.3                                    
 [93] GenomicAlignments_1.20.1                           
 [94] registry_0.5-1                                     
 [95] IlluminaHumanMethylation450kmanifest_0.4.0         
 [96] oompaBase_3.2.9                                    
 [97] xml2_1.3.2                                         
 [98] annotate_1.62.0                                    
 [99] rngtools_1.4                                       
[100] pkgmaker_0.27                                      
[101] multtest_2.40.0                                    
[102] beanplot_1.2                                       
[103] ruv_0.9.7.1                                        
[104] rvest_0.3.5                                        
[105] bibtex_0.4.2                                       
[106] doRNG_1.7.1                                        
[107] scrime_1.3.5                                       
[108] digest_0.6.25                                      
[109] cellranger_1.1.0                                   
[110] rmarkdown_2.1                                      
[111] base64_2.0                                         
[112] DelayedMatrixStats_1.8.0                           
[113] curl_4.3                                           
[114] Rsamtools_2.0.1                                    
[115] lifecycle_0.2.0                                    
[116] nlme_3.1-147                                       
[117] jsonlite_1.6.1                                     
[118] Rhdf5lib_1.6.1                                     
[119] mapproj_1.2.6                                      
[120] fansi_0.4.1                                        
[121] viridisLite_0.3.0                                  
[122] askpass_1.1                                        
[123] pillar_1.4.4                                       
[124] lattice_0.20-41                                    
[125] httr_1.4.1                                         
[126] survival_2.44-1.1                                  
[127] GO.db_3.8.2                                        
[128] bit_1.1-14                                         
[129] stringi_1.4.6                                      
[130] HDF5Array_1.14.4                                   
[131] rematch2_2.1.0                                     
[132] blob_1.2.0                                         
[133] org.Hs.eg.db_3.8.2                                 
[134] memoise_1.1.0