Source: https://github.com/markziemann/SurveyEnrichmentMethods

Intro

This script is designed to enable the complete analysis described in the article to be replicated with a single command.

By knitting this Rmd, it will reanalyse the data and regenerate all figures of the manuscript.

First of all, it is a good idea to check whether all of the requisite dependancies are installed.

Ubuntu users may need to install librsvg2-dev and libv8-dev to get DiagrammeR to work.

# for figure 2 and 3
library("wordcloud")
library("vioplot")
library("reutils")
library("XML")
library("kableExtra")
library("anytime")

# for figure 4
library("getDEE2") 
library("DESeq2")
library("clusterProfiler")
library("mitch")
library("kableExtra")
library("eulerr")
library("kableExtra")
library("beeswarm")

# for figure 1 / manuscript draft
library(rmdformats)
library(tidyverse)
library(DiagrammeR)
library(DiagrammeRsvg)
library(rsvg)

Execute the scripts

Here will re-run all of the analysis and re-build the manuscript draft.

# Figure 2
rmarkdown::render("analysis_code/analysis1.Rmd")
## 
## 
## processing file: analysis1.Rmd
## 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |..                                                                    |   3%
##    inline R code fragments
## 
## 
  |                                                                            
  |....                                                                  |   6%
## label: begin
## 
  |                                                                            
  |......                                                                |   8%
##   ordinary text without R code
## 
## 
  |                                                                            
  |........                                                              |  11%
## label: exclude1
## 
  |                                                                            
  |..........                                                            |  14%
##   ordinary text without R code
## 
## 
  |                                                                            
  |............                                                          |  17%
## label: Journal1
## 
  |                                                                            
  |..............                                                        |  19%
##   ordinary text without R code
## 
## 
  |                                                                            
  |................                                                      |  22%
## label: omics1
## 
  |                                                                            
  |..................                                                    |  25%
##   ordinary text without R code
## 
## 
  |                                                                            
  |...................                                                   |  28%
## label: org1
## 
  |                                                                            
  |.....................                                                 |  31%
##   ordinary text without R code
## 
## 
  |                                                                            
  |.......................                                               |  33%
## label: gsl1
## 
  |                                                                            
  |.........................                                             |  36%
##   ordinary text without R code
## 
## 
  |                                                                            
  |...........................                                           |  39%
## label: gsv1
## 
  |                                                                            
  |.............................                                         |  42%
##   ordinary text without R code
## 
## 
  |                                                                            
  |...............................                                       |  44%
## label: test1
## 
  |                                                                            
  |.................................                                     |  47%
##   ordinary text without R code
## 
## 
  |                                                                            
  |...................................                                   |  50%
## label: fdr1
## 
  |                                                                            
  |.....................................                                 |  53%
##   ordinary text without R code
## 
## 
  |                                                                            
  |.......................................                               |  56%
## label: app1
## 
  |                                                                            
  |.........................................                             |  58%
##   ordinary text without R code
## 
## 
  |                                                                            
  |...........................................                           |  61%
## label: appv1
## 
  |                                                                            
  |.............................................                         |  64%
##   ordinary text without R code
## 
## 
  |                                                                            
  |...............................................                       |  67%
## label: code1
## 
  |                                                                            
  |.................................................                     |  69%
##   ordinary text without R code
## 
## 
  |                                                                            
  |...................................................                   |  72%
## label: background1
## 
  |                                                                            
  |....................................................                  |  75%
##   ordinary text without R code
## 
## 
  |                                                                            
  |......................................................                |  78%
## label: genelists1
## 
  |                                                                            
  |........................................................              |  81%
##   ordinary text without R code
## 
## 
  |                                                                            
  |..........................................................            |  83%
## label: assumptions1
## 
  |                                                                            
  |............................................................          |  86%
##   ordinary text without R code
## 
## 
  |                                                                            
  |..............................................................        |  89%
## label: combined
## 
  |                                                                            
  |................................................................      |  92%
##   ordinary text without R code
## 
## 
  |                                                                            
  |..................................................................    |  94%
## label: gseaparam
## 
  |                                                                            
  |....................................................................  |  97%
##   ordinary text without R code
## 
## 
  |                                                                            
  |......................................................................| 100%
## label: session
## output file: analysis1.knit.md
## /usr/bin/pandoc +RTS -K512m -RTS analysis1.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output analysis1.html --lua-filter /usr/local/lib/R/site-library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /usr/local/lib/R/site-library/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --variable bs3=TRUE --standalone --section-divs --table-of-contents --toc-depth 3 --variable toc_float=1 --variable toc_selectors=h1,h2,h3 --variable toc_collapsed=1 --variable toc_smooth_scroll=1 --variable toc_print=1 --template /usr/local/lib/R/site-library/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --variable theme=bootstrap --include-in-header /tmp/Rtmp4AKZEm/rmarkdown-str1fbb6a235a566.html --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
## 
## Output created: analysis1.html
# Figure 3
rmarkdown::render("analysis_code/analysis2.Rmd")
## 
## 
## processing file: analysis2.Rmd
## 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |....                                                                  |   5%
##    inline R code fragments
## 
## 
  |                                                                            
  |.......                                                               |  10%
## label: begin
## 
  |                                                                            
  |..........                                                            |  15%
##   ordinary text without R code
## 
## 
  |                                                                            
  |..............                                                        |  20%
## label: exclude1
## 
  |                                                                            
  |..................                                                    |  25%
##   ordinary text without R code
## 
## 
  |                                                                            
  |.....................                                                 |  30%
## label: score
## 
  |                                                                            
  |........................                                              |  35%
##   ordinary text without R code
## 
## 
  |                                                                            
  |............................                                          |  40%
## label: journal rank
## 
  |                                                                            
  |................................                                      |  45%
##   ordinary text without R code
## 
## 
  |                                                                            
  |...................................                                   |  50%
## label: scoresvsjrank1
## 
  |                                                                            
  |......................................                                |  55%
##   ordinary text without R code
## 
## 
  |                                                                            
  |..........................................                            |  60%
## label: goodbadugly (with options) 
## List of 2
##  $ fig.height: num 5
##  $ fig.width : num 6
## 
  |                                                                            
  |..............................................                        |  65%
##   ordinary text without R code
## 
## 
  |                                                                            
  |.................................................                     |  70%
## label: scoresvsjrank2 (with options) 
## List of 2
##  $ fig.height: num 5
##  $ fig.width : num 6
## 
  |                                                                            
  |....................................................                  |  75%
##   ordinary text without R code
## 
## 
  |                                                                            
  |........................................................              |  80%
## label: cites
## 
  |                                                                            
  |............................................................          |  85%
##   ordinary text without R code
## 
## 
  |                                                                            
  |...............................................................       |  90%
## label: citesplot
## 
  |                                                                            
  |..................................................................    |  95%
##   ordinary text without R code
## 
## 
  |                                                                            
  |......................................................................| 100%
## label: session
## output file: analysis2.knit.md
## /usr/bin/pandoc +RTS -K512m -RTS analysis2.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output analysis2.html --lua-filter /usr/local/lib/R/site-library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /usr/local/lib/R/site-library/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --variable bs3=TRUE --standalone --section-divs --table-of-contents --toc-depth 3 --variable toc_float=1 --variable toc_selectors=h1,h2,h3 --variable toc_collapsed=1 --variable toc_smooth_scroll=1 --variable toc_print=1 --template /usr/local/lib/R/site-library/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --variable theme=bootstrap --include-in-header /tmp/Rtmp4AKZEm/rmarkdown-str1fbb6a69b12fac.html --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
## 
## Output created: analysis2.html
# uncomment the below line in order to update the number of accumulated
# citations for each article considered
#rmarkdown::render("analysis_code/citation_fetching.Rmd")

# Figure 4
rmarkdown::render("examples/examples.Rmd")
## 
## 
## processing file: examples.Rmd
## 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |.....                                                                 |   7%
##    inline R code fragments
## 
## 
  |                                                                            
  |..........                                                            |  14%
## label: begin0
## 
  |                                                                            
  |...............                                                       |  21%
##   ordinary text without R code
## 
## 
  |                                                                            
  |....................                                                  |  29%
## label: execute0
## 
  |                                                                            
  |.........................                                             |  36%
##   ordinary text without R code
## 
## 
  |                                                                            
  |..............................                                        |  43%
## label: getdata0 (with options) 
## List of 2
##  $ fig.width : num 7
##  $ fig.height: num 5
## 
## 
  |                                                                            
  |...................................                                   |  50%
##   ordinary text without R code
## 
## 
  |                                                                            
  |........................................                              |  57%
## label: summary_stats0
## 
  |                                                                            
  |.............................................                         |  64%
##   ordinary text without R code
## 
## 
  |                                                                            
  |..................................................                    |  71%
## label: jacbox0
## 
  |                                                                            
  |.......................................................               |  79%
##   ordinary text without R code
## 
## 
  |                                                                            
  |............................................................          |  86%
## label: jacbar0
## 
  |                                                                            
  |.................................................................     |  93%
##   ordinary text without R code
## 
## 
  |                                                                            
  |......................................................................| 100%
## label: session0
## output file: examples.knit.md
## /usr/bin/pandoc +RTS -K512m -RTS examples.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output examples.html --lua-filter /usr/local/lib/R/site-library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /usr/local/lib/R/site-library/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --variable bs3=TRUE --standalone --section-divs --table-of-contents --toc-depth 3 --variable toc_float=1 --variable toc_selectors=h1,h2,h3 --variable toc_collapsed=1 --variable toc_smooth_scroll=1 --variable toc_print=1 --template /usr/local/lib/R/site-library/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --variable theme=bootstrap --include-in-header /tmp/Rtmp4AKZEm/rmarkdown-str1fbb6a10380d79.html --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --variable code_folding=hide --variable code_menu=1
## 
## Output created: examples.html
# Figure 1 and assemble a manuscript draft
rmarkdown::render("docs/manuscript.Rmd")
## 
## 
## processing file: manuscript.Rmd
## 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |.......................                                               |  33%
##    inline R code fragments
## 
## 
  |                                                                            
  |...............................................                       |  67%
## label: diagram1 (with options) 
## List of 3
##  $ echo      : logi FALSE
##  $ fig.width : num 8
##  $ fig.height: num 4
## 
## 
  |                                                                            
  |......................................................................| 100%
##   ordinary text without R code
## output file: manuscript.knit.md
## Warning: MathJax doesn't work with self_contained when not using the rmarkdown
## "default" template.
## /usr/bin/pandoc +RTS -K512m -RTS manuscript.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output manuscript.html --lua-filter /usr/local/lib/R/site-library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /usr/local/lib/R/site-library/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --variable 'robobook:true' --variable 'gallery:false' --variable bs3=TRUE --standalone --section-divs --table-of-contents --toc-depth 2 --template /usr/local/lib/R/site-library/rmdformats/templates/template.html --highlight-style kate --variable theme=bootstrap --include-in-header /tmp/Rtmp4AKZEm/rmarkdown-str1fbb6a44ad59fa.html
## 
## Output created: manuscript.html