Last updated: 2021-03-10
Checks: 7 0
Knit directory: mmbr-rss-dsc/
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(20200227)
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 53ee245. 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: .DS_Store
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: data/.DS_Store
Ignored: output/.DS_Store
Untracked files:
Untracked: data/ENSG00000140265.12.Multi_Tissues.rds
Untracked: data/FastQTLSumStats.mash.FL_PC3.rds
Untracked: data/mmbr_ukb_simulation/
Untracked: data/mmbr_ukb_simulation_problem/
Untracked: data/ukb_rss_naive_lfsr_problem.rds
Untracked: data/ukb_rss_naive_pip_problem.rds
Untracked: output/GTExprofile_res.rds
Untracked: output/GTExprofile_resL1.rds
Untracked: output/GTExprofile_resL1_elbo.rds
Untracked: output/GTExprofile_resL3.rds
Untracked: output/GTExprofile_resL3_elbo.rds
Untracked: output/GTExprofile_res_elbo.rds
Untracked: output/GTExprofile_resapprox.rds
Untracked: output/GTExprofile_resapproxL1.rds
Untracked: output/GTExprofile_resapproxL1_elbo.rds
Untracked: output/GTExprofile_resapproxL3.rds
Untracked: output/GTExprofile_resapproxL3_elbo.rds
Untracked: output/GTExprofile_resapprox_elbo.rds
Untracked: output/GTExprofile_resapproxdiag.rds
Untracked: output/GTExprofile_resapproxdiagL1.rds
Untracked: output/GTExprofile_resapproxdiagL1_elbo.rds
Untracked: output/GTExprofile_resapproxdiagL3.rds
Untracked: output/GTExprofile_resapproxdiagL3_elbo.rds
Untracked: output/GTExprofile_resapproxdiag_elbo.rds
Untracked: output/GTExprofile_resdiag.rds
Untracked: output/mmbr_gtex_res.Rprof
Untracked: output/mmbr_gtex_res_approx.Rprof
Untracked: output/mmbr_gtex_res_approx_diag.Rprof
Untracked: output/mmbr_gtex_res_diag.Rprof
Untracked: output/mnm_missing_output.20200527.rds
Untracked: output/test
Untracked: output/tiny_data_211_cond2L2.gif
Untracked: output/tiny_data_211_cond2L2.pdf
Untracked: output/tiny_data_211_cond2L3.gif
Untracked: output/tiny_data_211_cond2L3.pdf
Untracked: output/tiny_data_211_cond2initL3.gif
Untracked: output/tiny_data_211_cond2initL3.pdf
Untracked: output/ukb_rss_20200107/
Unstaged changes:
Modified: analysis/mmbr_missing_rss_problem1.Rmd
Modified: output/ukb_prior_simulation.rds
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/create_simulation_priors.Rmd
) and HTML (docs/create_simulation_priors.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 | 53ee245 | zouyuxin | 2021-03-10 | wflow_publish(“analysis/create_simulation_priors.Rmd”) |
html | ed6347f | zouyuxin | 2021-03-10 | Build site. |
Rmd | 5825746 | zouyuxin | 2021-03-10 | wflow_publish(“analysis/create_simulation_priors.Rmd”) |
html | 756535e | zouyuxin | 2020-12-30 | Build site. |
html | 329e27d | zouyuxin | 2020-12-30 | Build site. |
Rmd | a6db4bf | zouyuxin | 2020-12-30 | wflow_publish(“analysis/create_simulation_priors.Rmd”) |
html | a93a74b | zouyuxin | 2020-12-30 | Build site. |
Rmd | 6a8fc02 | zouyuxin | 2020-12-30 | wflow_publish(“analysis/create_simulation_priors.Rmd”) |
html | bcf184e | zouyuxin | 2020-12-30 | Build site. |
Rmd | 5d9fa8d | zouyuxin | 2020-12-30 | wflow_publish(“analysis/create_simulation_priors.Rmd”) |
html | 39e04e3 | zouyuxin | 2020-12-18 | Build site. |
html | f93e386 | zouyuxin | 2020-12-16 | Build site. |
Rmd | d20e5d4 | zouyuxin | 2020-12-16 | wflow_publish(“analysis/create_simulation_priors.Rmd”) |
html | 6fb63e9 | zouyuxin | 2020-12-16 | Build site. |
Rmd | 98e244e | zouyuxin | 2020-12-16 | wflow_publish(“analysis/create_simulation_priors.Rmd”) |
Canonical patterns of sharing:
R = 20
prior = mmbr:::create_cov_canonical(R)
Paired sharing:
paired = matrix(0,R,R)
paired[1:2,1:2] = 1
prior[['paired_1']] = paired
paired = matrix(0,R,R)
paired[10:11,10:11] = 1
prior[['paired_2']] = paired
Block sharing:
block = matrix(0,R,R)
block[1:R/2, 1:R/2] = 1
block[(R/2+1):R, (R/2+1):R] = 1
prior[['blocked_1']] = block
We assign weights to priors:
singleton total 25%
singleton_1 has 15%
singleton_2 to singleton_11 has 10% (1% each)
shared total 25%
paired 30% (15% each)
blocked 20%
w = c(0.15, rep(0.01, 10), rep(0, 9), rep(0.05, 5), rep(0.15,2), 0.2)
prior = prior[which(w>0)]
w = w[which(w>0)]
artificial_mixture_20 = list(U=prior,w=w)
Canonical patterns of sharing:
R = 4
prior = mmbr:::create_cov_canonical(R)
Paired sharing:
paired = matrix(0,R,R)
paired[1:2,1:2] = 1
prior[['paired_1']] = paired
Block sharing:
block = matrix(0,R,R)
block[1:R/2, 1:R/2] = 1
block[(R/2+1):R, (R/2+1):R] = 1
prior[['blocked_1']] = block
We assign weights to priors:
singleton total 30%
shared total 50%
paired 10%
blocked 10%
w = c(0.15, 0.15, 0, 0, rep(0.5/5,5), 0.1, 0.1)
prior = prior[which(w>0)]
names(prior)
[1] "singleton_1" "singleton_2" "shared_1" "shared_2" "shared_3"
[6] "shared_4" "shared_5" "paired_1" "blocked_1"
w = w[which(w>0)]
artificial_mixture_4 = list(U=prior,w=w)
Canonical patterns of sharing:
R = 2
prior = mmbr:::create_cov_canonical(R)
We assign weights to priors:
singleton total 40%
shared total 60%
w = c(0.2, 0.2, rep(0.6/5,5))
prior = prior[which(w>0)]
names(prior)
[1] "singleton_1" "singleton_2" "shared_1" "shared_2" "shared_3"
[6] "shared_4" "shared_5"
w = w[which(w>0)]
artificial_mixture_2 = list(U=prior,w=w)
The priors are from this workflow.
prior = readRDS('~/Documents/GitHub/finemap-uk-biobank/output/BloodCells.Ulist.Scor.ed.rds')
names(prior$U)
[1] "FLASH_1" "FLASH_2" "FLASH_3" "FLASH_4" "FLASH_5" "FLASH_6"
[7] "FLASH_7" "FLASH_8" "FLASH_9" "FLASH_10" "FLASH_11" "FLASH_12"
[13] "FLASH_13" "tFLASH" "PCA_1" "PCA_2" "PCA_3" "tPCA"
[19] "XX"
Most weighths are in tFLASH and XX,
names(prior$U)[prior$w>0.1]
[1] "tFLASH" "XX"
But many other weights are also non-trivial
names(prior$U)[prior$w > 0.001]
[1] "FLASH_1" "FLASH_2" "FLASH_3" "FLASH_4" "FLASH_5" "FLASH_6"
[7] "FLASH_7" "FLASH_8" "FLASH_9" "FLASH_10" "FLASH_12" "FLASH_13"
[13] "tFLASH" "tPCA" "XX"
tol=1E-12
U = prior$U[which(prior$w>tol)]
w = prior$w[which(prior$w>tol)]
names(U)
[1] "FLASH_1" "FLASH_2" "FLASH_3" "FLASH_4" "FLASH_5" "FLASH_6"
[7] "FLASH_7" "FLASH_8" "FLASH_9" "FLASH_10" "FLASH_12" "FLASH_13"
[13] "tFLASH" "PCA_3" "tPCA" "XX"
bloodcells_mixture = list(U=U,w=w)
for(i in 1:length(U)){
bloodcells_mixture$U[[i]] = (bloodcells_mixture$U[[i]] + t(bloodcells_mixture$U[[i]]))/2
eigenU = eigen(bloodcells_mixture$U[[i]], symmetric = T)
if(any(eigenU$values<0)){
eigenU$values[eigenU$values < 0] = 0
bloodcells_mixture$U[[i]] = eigenU$vectors %*% (t(eigenU$vectors) * eigenU$values)
}
}
saveRDS(list(bloodcells_mixture=bloodcells_mixture, artificial_mixture_20=artificial_mixture_20, artificial_mixture_4=artificial_mixture_4, artificial_mixture_2 = artificial_mixture_2), 'output/ukb_prior_simulation.rds')
sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/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] workflowr_1.6.2
loaded via a namespace (and not attached):
[1] progress_1.2.2 tidyselect_1.1.0 xfun_0.19 ashr_2.2-51
[5] purrr_0.3.4 lattice_0.20-41 colorspace_2.0-0 vctrs_0.3.6
[9] generics_0.1.0 htmltools_0.5.0 yaml_2.2.1 rlang_0.4.10
[13] mixsqp_0.3-46 later_1.1.0.1 pillar_1.4.7 glue_1.4.2
[17] plyr_1.8.6 matrixStats_0.58.0 lifecycle_1.0.0 stringr_1.4.0
[21] munsell_0.5.0 gtable_0.3.0 mvtnorm_1.1-1 evaluate_0.14
[25] knitr_1.30 httpuv_1.5.4 invgamma_1.1 irlba_2.3.3
[29] Rcpp_1.0.6 promises_1.1.1 scales_1.1.1 susieR_0.10.0
[33] truncnorm_1.0-8 abind_1.4-5 fs_1.5.0 ggplot2_3.3.3
[37] hms_1.0.0 digest_0.6.27 stringi_1.5.3 dplyr_1.0.2
[41] mmbr_0.0.2.0429 grid_4.0.3 rprojroot_2.0.2 tools_4.0.3
[45] magrittr_2.0.1 tibble_3.0.6 crayon_1.4.1 whisker_0.4
[49] pkgconfig_2.0.3 ellipsis_0.3.1 Matrix_1.2-18 SQUAREM_2021.1
[53] prettyunits_1.1.1 rmarkdown_2.5 reshape_0.8.8 R6_2.5.0
[57] git2r_0.27.1 compiler_4.0.3