Last updated: 2020-05-29

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 49cf167. 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:    code/.job/
    Ignored:    code/old/
    Ignored:    data/
    Ignored:    output/FDR-analysis/
    Ignored:    output/compare-methods/
    Ignored:    output/methylgsa-params/
    Ignored:    output/random-cpg-sims/

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/methylGSAParamSweep.Rmd) and HTML (docs/methylGSAParamSweep.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 49cf167 Jovana Maksimovic 2020-05-29 wflow_publish(c(“analysis/methylGSAParamSweep.Rmd”, “analysis/index.Rmd”))


Explore effect of minimum and maximum gene set size parameters

Load data

We have run all three methylGSA methods, testing GO categories, on the three blood cell contrasts for the following combinations of minimum and maximum gene set size parameters:

params <- data.frame(minsize = c(1:5, rep(5, 5)),                      
                     maxsize = c(rep(5000, 5), seq(7000, 18000, by = 2750)))
   minsize maxsize
1        1    5000
2        2    5000
3        3    5000
4        4    5000
5        5    5000
6        5    7000
7        5    9750
8        5   12500
9        5   15250
10       5   18000

Read in the results of all the analyses.

inFile <- here("output/methylgsa-params/methylGSA-param-sweep.rds")
dat <- readRDS(inFile)

Examine results

dat %>% mutate(combo = glue("{minsize}.{maxsize}")) %>%
    group_by(method, contrast, combo) %>%
    mutate(rank = 1:n()) %>%
    filter(rank <= 20) %>% 
    group_by(method, contrast) %>%
    mutate(params = factor(combo),
           params = factor(params,
                           levels = levels(params)[order(c(1:4,8:10,5:7))])) -> sub

methods <- c("glm", "gsea", "ora")
p <- vector("list", length(methods))

for(i in 1:length(methods)){
    sub %>% filter(method == methods[i]) -> subMeth
    p[[i]] <- ggplot(subMeth, aes(x=rank, y=Size)) +
        geom_bar(stat = "identity", position = "dodge") +
        facet_grid(params ~ contrast, scales = "free_y") +
        theme(legend.position = "bottom") +
        labs(x = "Rank", y = "No. genes in set") +

p[[1]] / p[[2]] / p[[3]]

# sub %>% gt()
#     fmt_number(columns = vars(mean, mins), decimals = 2) %>%
#     cols_label(
#         mean = md("**Seconds**"),
#         mins = md("**Minutes**"),
#         method = md("**Method**")
#         ) %>%
#   tab_header(
#     title = md("**Average run-time across all contrasts**"),
#     subtitle = md("Using Broad MSigDB gene sets from `ChAMP` package")
#     ) %>%
#   tab_source_note(md("_*All methods were run on a single core._"))

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/
LAPACK: /config/RStudio/R/3.6.1/lib64/R/lib/

 [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8    
 [7] LC_PAPER=en_AU.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            

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

other attached packages:
 [1] gt_0.2.0.5      patchwork_1.0.0 forcats_0.4.0   stringr_1.4.0  
 [5] dplyr_0.8.5     purrr_0.3.4     readr_1.3.1     tidyr_1.1.0    
 [9] tibble_3.0.1    tidyverse_1.3.0 glue_1.4.1      ggplot2_3.3.0  
[13] reshape2_1.4.3  here_0.1        workflowr_1.6.2

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.4.6     lubridate_1.7.4  lattice_0.20-41  assertthat_0.2.1
 [5] rprojroot_1.3-2  digest_0.6.25    R6_2.4.1         cellranger_1.1.0
 [9] plyr_1.8.6       backports_1.1.7  reprex_0.3.0     evaluate_0.14   
[13] httr_1.4.1       pillar_1.4.4     rlang_0.4.6      readxl_1.3.1    
[17] rstudioapi_0.11  whisker_0.4      rmarkdown_2.1    labeling_0.3    
[21] munsell_0.5.0    broom_0.5.2      compiler_3.6.1   httpuv_1.5.2    
[25] modelr_0.1.8     xfun_0.14        pkgconfig_2.0.3  htmltools_0.4.0 
[29] tidyselect_1.1.0 fansi_0.4.1      crayon_1.3.4     dbplyr_1.4.2    
[33] withr_2.2.0      later_1.0.0      grid_3.6.1       nlme_3.1-147    
[37] jsonlite_1.6.1   gtable_0.3.0     lifecycle_0.2.0  DBI_1.0.0       
[41] git2r_0.27.1     magrittr_1.5     scales_1.1.1     cli_2.0.2       
[45] stringi_1.4.6    farver_2.0.3     fs_1.4.1         promises_1.1.0  
[49] xml2_1.3.2       ellipsis_0.3.1   generics_0.0.2   vctrs_0.3.0     
[53] tools_3.6.1      hms_0.5.3        yaml_2.2.1       colorspace_1.4-1
[57] rvest_0.3.5      knitr_1.28       haven_2.2.0