This repository contains the code used to run data analyses for Metabolic predictors of phenotypic traits can replace and complement measured clinical variables in transcriptome-wide association studies by Anna Niehues, Daniele Bizzarri, Marcel J.T. Reinders, P. Eline Slagboom, Alain J. van Gool, Erik B. van den Akker, and Peter A.C. 't Hoen, with the BBMRI-NL BIOS and Metabolomics Consortia.
To run analyses in the SURF Research Cloud of the BBMRI-NL BIOS consortium, create a BBMRI BIOS flavoured R-Studio version 4.0.3 workspace and clone this repository. Run the RStudio server, install the R package renv
- install.packages("renv")
, open the R project surrogate_vs_reported\surrogate_vs_reported.Rproj, and restore the project's dependencies - renv::restore()
.
This project uses drake
for workflow management. Run the script surrogate_vs_reported\run.R to run the complete pipeline and render markdown reports with the results.
See surrogate_vs_reported\interactive.R for example commands to run drake
workflow in an interactive R session.
A brief overview of commands is given below. See this introduction to the renv workflow for more detail.
renv::init() # initialize the project package environment, create lockfile
renv::snapshot() # save current state of library to lockfile `renv.lock`
renv::restore() # restore environment from lockfile (e.g. in a new VM)
This might be necessary if packages are not automatically restored from surrogate_vs_reported\renv.lock.
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("preprocessCore", update = FALSE)
BiocManager::install("bacon", update = FALSE)
BiocManager::install("limma", update = FALSE)
BiocManager::install("edgeR", update = FALSE)
BiocManager::install("fgsea", update = FALSE)
BiocManager::install("org.Hs.eg.db", update = FALSE)
BiocManager::install("reactome.db", update = FALSE)
renv::snapshot()
Checking data availability via BBMRIomics
library(BBMRIomics)
data(package = "BBMRIomics")
# example data load
# BBMRIomics::bbmri.data(rnaSeqData_ReadCounts_NTR_Freeze2_unrelated)