This .Rmd file contains the code to reproduce the tables and figures in the paper Simultaneous SNP selection and adjustment for population structure in high dimensional prediction models. Bhatnagar et al. (2020). PLOS Genetics.

How to compile this document

The easiest way to compile this document is to clone the https://github.com/sahirbhatnagar/ggmix repository or download the zip file https://github.com/sahirbhatnagar/ggmix/archive/master.zip. Open the file manuscript/bin/tables-figures.Rmd in RStudio and click on the Knit button. If you don't use RStudio, then from the R console enter rmarkdown::render("manuscript/bin/tables-figures.Rmd"). This assumes that you have installed both the knitr and rmarkdown packages, and are in the root of the ggmix folder.

The order in which the tables and figures appear follow that of the paper. The R scripts for each Table and Figure are in separate R files found in the manuscript/bin folder. This .Rmd document uses code externalization.

Load Requires Packages

knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE)
options(digits = 4, scipen = 2)
knitr::read_chunk(here::here("manuscript/bin/setup.R"))
knitr::read_chunk(here::here("manuscript/bin/simulation.R"))
knitr::read_chunk(here::here("manuscript/bin/GAW20.R"))
knitr::read_chunk(here::here("manuscript/bin/UKB.R"))
knitr::read_chunk(here::here("manuscript/bin/mice.R"))


Figure 1


Figure 2


Table 1

The simulation study results were run on a cluster using the simulator package. The simulator files can be found in the simulation folder:




Figure 3


Table 2


Figure 4


S1 Figure


S2 Figure


S3 Figure


File and Session Information

if (!requireNamespace("devtools")) sessionInfo() else devtools::session_info()


sahirbhatnagar/penfam documentation built on April 14, 2021, 9:38 a.m.