Last updated: 2020-03-31
Checks: 6 0
Knit directory: mr-ash-workflow/
This reproducible R Markdown analysis was created with workflowr (version 1.3.0). 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(20191007)
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! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.
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/
Untracked files:
Untracked: .DS_Store
Untracked: .gitignore
Unstaged changes:
Modified: code/method_wrapper.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 R Markdown and HTML files. If you’ve configured a remote Git repository (see ?wflow_git_remote
), click on the hyperlinks in the table below to view them.
File | Version | Author | Date | Message |
---|---|---|---|---|
Rmd | 03ddbf1 | Youngseok Kim | 2020-03-31 | wflow_publish(“analysis/index.Rmd”) |
html | 89f53dc | Youngseok Kim | 2020-03-31 | Build site. |
html | cd5f2c6 | Youngseok Kim | 2020-03-31 | Build site. |
Rmd | 5d21586 | Youngseok Kim | 2020-03-31 | wflow_publish(“analysis/index.Rmd”) |
html | c8fb6bb | Youngseok Kim | 2020-03-31 | Build site. |
html | 32985f7 | Youngseok Kim | 2020-03-31 | Build site. |
html | 98d796f | Youngseok Kim | 2020-03-31 | Build site. |
Rmd | d761d84 | Youngseok Kim | 2020-03-31 | wflow_publish(“analysis/index.Rmd”) |
html | 9ee2fe4 | Youngseok Kim | 2020-03-31 | Build site. |
Rmd | b326ec9 | Youngseok Kim | 2020-03-31 | wflow_publish(“analysis/index.Rmd”) |
Rmd | 9e3a3ef | Youngseok Kim | 2020-03-31 | update index.rmd |
html | 9e3a3ef | Youngseok Kim | 2020-03-31 | update index.rmd |
html | 21408dd | Youngseok Kim | 2020-03-31 | Build site. |
Rmd | 151d607 | Youngseok Kim | 2020-03-31 | wflow_publish(“analysis/index.Rmd”) |
html | 62486eb | Youngseok Kim | 2020-03-17 | Build site. |
html | cc096ed | Youngseok Kim | 2019-10-31 | Build site. |
Rmd | 48b4de2 | Youngseok Kim | 2019-10-31 | wflow_publish(“analysis/index.Rmd”) |
html | b3ea205 | Peter Carbonetto | 2019-10-30 | Re-built home page with “source” link in navigation bar. |
Rmd | 5ca88f2 | Youngseok Kim | 2019-10-24 | update vignettes |
html | cf97c6b | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 2e1d0c4 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | b967cb4 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 9038d27 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | 61571b0 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 57610d4 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | dd02fcc | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 75d105c | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | 32d0091 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 2c0dc4f | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | c180256 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | dccf722 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | b8d5cb6 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 990045d | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | 4484e99 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 67178ce | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | 46a6d53 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 4c49871 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | 1a67418 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 84b1fd6 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | 782d931 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 9ea889c | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | a9435be | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 859bd6c | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | c861138 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | e9e17ff | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | 1458fd6 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 5f6d6e3 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | 1537db4 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 118da06 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | 2ebf6f7 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | d8f6a69 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | 785909d | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 1665384 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | 93b9710 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 9569eb7 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | 07742e3 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | ebac94a | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | 0aec516 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | b2eb7c2 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | b610554 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 23b1ac2 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | d63eb8c | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | a78ca10 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | dbd8cca | Youngseok Kim | 2019-10-23 | Build site. |
html | 1adb699 | Youngseok Kim | 2019-10-23 | Build site. |
html | 3d22ee3 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 49d71a9 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | c584369 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | c7f8752 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | 5eeac95 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | a7cde52 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | b835c0f | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 9fec1c9 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | 554bd5d | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 9f32d59 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | 75a4f55 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 6fa74a6 | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | f669a52 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | a36da9c | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | cc6df17 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | a0a663d | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | bf5aa73 | Youngseok Kim | 2019-10-23 | Build site. |
Rmd | 56cc6bd | Youngseok Kim | 2019-10-23 | wflow_publish(“analysis/index.Rmd”) |
html | a0bc78b | Youngseok | 2019-10-22 | Build site. |
Rmd | a4de5b2 | Youngseok | 2019-10-22 | wflow_publish(“analysis/index.Rmd”) |
html | 668d700 | Youngseok | 2019-10-22 | Build site. |
Rmd | 4f8651a | Youngseok | 2019-10-22 | update changepoint analysis |
html | 7cf4984 | Youngseok | 2019-10-21 | Build site. |
Rmd | 6025590 | Youngseok | 2019-10-21 | wflow_publish(“analysis/index.Rmd”) |
html | 7d6c1c8 | Youngseok | 2019-10-21 | Build site. |
Rmd | 585044e | Youngseok Kim | 2019-10-21 | update |
Rmd | 3bab6f7 | Youngseok Kim | 2019-10-20 | update experiments |
html | 3bab6f7 | Youngseok Kim | 2019-10-20 | update experiments |
html | 92022af | Youngseok Kim | 2019-10-17 | Build site. |
Rmd | 897fd56 | Youngseok Kim | 2019-10-17 | update index.html |
html | 4d0a59b | Youngseok Kim | 2019-10-17 | Build site. |
Rmd | 6173f3e | Youngseok Kim | 2019-10-17 | update index.html |
html | 2ca8e0c | Youngseok Kim | 2019-10-17 | Build site. |
Rmd | 5d8193f | Youngseok Kim | 2019-10-17 | update index.html |
html | 79e1aab | Youngseok | 2019-10-17 | Build site. |
html | b091d16 | Youngseok | 2019-10-15 | Build site. |
Rmd | 5a648ed | Youngseok | 2019-10-15 | wflow_publish(“analysis/index.Rmd”) |
html | fd5131c | Youngseok | 2019-10-15 | Build site. |
Rmd | c0d6ee9 | Youngseok | 2019-10-15 | wflow_publish("analysis/*.Rmd") |
Rmd | 1e3484c | Youngseok | 2019-10-14 | update for experiment with different p |
html | d92cdd7 | Youngseok | 2019-10-14 | Build site. |
Rmd | 8dc7015 | Youngseok | 2019-10-14 | wflow_publish(“analysis/index.Rmd”) |
html | a7a31a3 | Youngseok | 2019-10-14 | Build site. |
Rmd | bee359c | Youngseok | 2019-10-14 | wflow_publish(“analysis/index.Rmd”) |
html | 8bdd1d7 | Youngseok | 2019-10-14 | Build site. |
Rmd | cb56b49 | Youngseok | 2019-10-14 | wflow_publish(“analysis/index.Rmd”) |
html | 70efed9 | Youngseok | 2019-10-14 | Build site. |
Rmd | 6167c5a | Youngseok | 2019-10-14 | wflow_publish("analysis/*.Rmd") |
html | ac5fb62 | Youngseok | 2019-10-13 | Build site. |
Rmd | 10c93e1 | Youngseok | 2019-10-13 | wflow_publish(“analysis/Index.Rmd”) |
html | bd36a79 | Youngseok | 2019-10-13 | Build site. |
Rmd | 2368046 | Youngseok | 2019-10-13 | wflow_publish("analysis/*.Rmd") |
Rmd | 1207fdd | Youngseok | 2019-10-07 | Start workflowr project. |
To build this vignette, run
workflowr::wflow_publish("analysis/index.Rmd")
or rmarkdown::render("analysis/index.Rmd")
from your R console.
library(workflowr);
For package version and information, see Session Information
at the end of this documentation.
library(mr.ash.alpha); # package implementing proposed methods in the paper
library(Matrix); library(mvtnorm) # miscellaneous packages for matrices
library(glmnet); library(ncvreg); library(L0Learn); # penalized regression methods
library(varbvs); library(susieR); library(BGLR); # Bayesian methods
library(ggplot2); library(cowplot); # plotting
First, load the main functions.
source('code/method_wrapper.R')
source('code/sim_wrapper.R')
One can generate the data as follows.
data = simulate_data(n = 100, p = 200, s = 5,
design = "indepgauss", # "equicorrgauss",
signal = "normal", # "lap", "t", etc.
pve = 0.5)
str(data)
List of 6
$ X : num [1:100, 1:200] 1.291 0.224 1.232 -0.869 -1.274 ...
$ X.test: num [1:100, 1:200] -0.0288 -0.1941 -0.9014 1.3133 -0.8224 ...
$ y : num [1:100, 1] -2.42 -6.62 -4.42 2.53 7.11 ...
$ y.test: num [1:100, 1] -0.277 -4.877 7.563 3.549 3.187 ...
$ sigma : num 2.62
$ beta : num [1:200] 0 0 0 0 0 0 0 0 0 0 ...
One can run each method by calling the wrapper. For instacne, for fitting mr.ash
simply call fit.mr.ash
.
method_list = c("mr.ash","varbvs","bayesb","blasso","susie","enet","lasso","ridge","scad2","mcp2","l0learn")
fit.function = get(paste0("fit.", method_list[1], sep = ""))
fit = fit.function(data$X, data$y, data$X.test, data$y.test)
Each fit.function
runs under the default setting of each method.
It can accept non-default argument, for instance, fit.susie(..., L = 20)
.
To reproduce the results in the paper, run the following code.
You need to install workflowr
R package, or replace workflowr::wflow_publish
by rmarkdown::render
.
In analysis
folder of the repository, *_Sourcecode.Rmd
files (e.g. Figure2_Sourcecode1.Rmd) contain source codes.
Each *_Sourcecode.Rmd
file requires minutes/hours/days to be rendered by MacBook Pro (15-inch, 2016) 2.6 GHz Intel Core i7 16GB RAM.
filelist = paste("analysis/", list.files("analysis", pattern = "*_Sourcecode.Rmd"), sep = "")
for (i in 1:length(filelist)) {
workflowr::wflow_publish(filelist[i])
cat("file",i,": ",'"',filelist[i],'"'," is published\n",sep = "")
}
To generate figures in the paper, run the following code.
You need to have results from the code in the above chunk.
filelist = paste("analysis/", list.files("analysis", pattern = "*_Plot.Rmd"), sep = "")
for (i in 1:length(filelist)) {
workflowr::wflow_publish(filelist[i])
cat("file",i,": ",'"',filelist[i],'"'," is published\n",sep = "")
}
The below is for providing R version and package information.
sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.3
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] cowplot_0.9.4 ggplot2_3.2.1 BGLR_1.0.8
[4] susieR_0.7.1 varbvs_2.6-5 L0Learn_1.1.0
[7] ncvreg_3.11-1 glmnet_2.0-16 foreach_1.4.8
[10] mvtnorm_1.0-12 Matrix_1.2-17 mr.ash.alpha_0.1-4
[13] workflowr_1.3.0
loaded via a namespace (and not attached):
[1] tidyselect_0.2.5 xfun_0.6 purrr_0.3.3
[4] reshape2_1.4.3 lattice_0.20-38 colorspace_1.4-1
[7] htmltools_0.4.0 yaml_2.2.0 rlang_0.4.2
[10] pillar_1.4.3 glue_1.3.1 withr_2.1.2
[13] RColorBrewer_1.1-2 lifecycle_0.1.0 plyr_1.8.5
[16] stringr_1.4.0 munsell_0.5.0 gtable_0.3.0
[19] codetools_0.2-16 evaluate_0.13 latticeExtra_0.6-28
[22] knitr_1.22 Rcpp_1.0.3 scales_1.1.0
[25] backports_1.1.5 truncnorm_1.0-8 fs_1.3.0
[28] digest_0.6.23 stringi_1.4.5 dplyr_0.8.3
[31] nor1mix_1.2-3 grid_3.5.3 rprojroot_1.3-2
[34] tools_3.5.3 magrittr_1.5 lazyeval_0.2.2
[37] tibble_2.1.3 crayon_1.3.4 whisker_0.3-2
[40] pkgconfig_2.0.3 assertthat_0.2.1 rmarkdown_1.12
[43] iterators_1.0.12 R6_2.4.1 git2r_0.25.2
[46] compiler_3.5.3
sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.3
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] cowplot_0.9.4 ggplot2_3.2.1 BGLR_1.0.8
[4] susieR_0.7.1 varbvs_2.6-5 L0Learn_1.1.0
[7] ncvreg_3.11-1 glmnet_2.0-16 foreach_1.4.8
[10] mvtnorm_1.0-12 Matrix_1.2-17 mr.ash.alpha_0.1-4
[13] workflowr_1.3.0
loaded via a namespace (and not attached):
[1] tidyselect_0.2.5 xfun_0.6 purrr_0.3.3
[4] reshape2_1.4.3 lattice_0.20-38 colorspace_1.4-1
[7] htmltools_0.4.0 yaml_2.2.0 rlang_0.4.2
[10] pillar_1.4.3 glue_1.3.1 withr_2.1.2
[13] RColorBrewer_1.1-2 lifecycle_0.1.0 plyr_1.8.5
[16] stringr_1.4.0 munsell_0.5.0 gtable_0.3.0
[19] codetools_0.2-16 evaluate_0.13 latticeExtra_0.6-28
[22] knitr_1.22 Rcpp_1.0.3 scales_1.1.0
[25] backports_1.1.5 truncnorm_1.0-8 fs_1.3.0
[28] digest_0.6.23 stringi_1.4.5 dplyr_0.8.3
[31] nor1mix_1.2-3 grid_3.5.3 rprojroot_1.3-2
[34] tools_3.5.3 magrittr_1.5 lazyeval_0.2.2
[37] tibble_2.1.3 crayon_1.3.4 whisker_0.3-2
[40] pkgconfig_2.0.3 assertthat_0.2.1 rmarkdown_1.12
[43] iterators_1.0.12 R6_2.4.1 git2r_0.25.2
[46] compiler_3.5.3