Last updated: 2022-05-30

Checks: 7 0

Knit directory: meSuSie_Analysis/

This reproducible R Markdown analysis was created with workflowr (version 1.7.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(20220530) 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 dd94ff3. 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:


working directory clean

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/example_analysis.Rmd) and HTML (docs/example_analysis.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 dd94ff3 borangao 2022-05-30 Add my first analysis
html 8a1d176 borangao 2022-05-30 Build site.
Rmd a117569 borangao 2022-05-30 Add my first analysis

Package Installation

Install meSuSie package maintained in github through the “devtools” package.

if(!require(devtools))
  install.packages(devtools)
devtools::install_github("borangao/meSuSie")

Input Data

meSuSie requires correlation matrix and summary statistics. Correlation matrices are stored in a list, with element of the list being the correlation matrix from each ancestry. The column name of the matrix is the name of the SNP, and the order of the SNP should be consistent with the order in summary statistics. Summary statistics are stored in a list with length of the number ancestry. Each element of the list is the summary statistics for the ancestry. The minimum requirement of the summary statistics require the information of SNP, Beta, Se, Z and N. The column names should be exactly match for meSuSie to run.

Data Loading and Run meSuSie Analysis

library(meSuSie)
data("R_mat_list") 
data("summary_stat_list")
test_meSuSie<-meSuSie_core(R_mat_list,summary_stat_list,L=10,residual_variance=NULL,prior_weights=NULL,optim_method ="optim",estimate_residual_variance =F,max_iter =100)
*************************************************************

  Multiple Ancestry Sum of Single Effect Model (meSuSie)          

   Visit http://www.xzlab.org/software.html For Update            

            (C) 2022 Boran Gao, Xiang Zhou                        

              GNU General Public License                          

*************************************************************
# Start data processing for sufficient statistics 
# Create meSuSie object 
# Start data analysis 

# Data analysis is done, and now generates result 

Potential causal SNPs with PIP > 0.5:  SNP7 SNP413 

Credible sets for effects: 
$cs
$cs$L1
[1] 413

$cs$L2
[1] 7


$purity
   min.abs.corr mean.abs.corr median.abs.corr
L1            1             1               1
L2            1             1               1

$cs_index
[1] 1 2

$coverage
[1] 1 1

$requested_coverage
[1] 0.95


 Use meSusie_plot_pip() for Mahattan and PIP Plot
# Total time used for the analysis: 0.13 mins

Visualization: Manhattan and PIP Plot

library(ggplot2)
meSusie_plot_pip(test_meSuSie,R_mat_list,summary_stat_list)


sessionInfo()
R version 4.2.0 (2022-04-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.6 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggplot2_3.3.6   meSuSie_1.0     workflowr_1.7.0

loaded via a namespace (and not attached):
 [1] progress_1.2.2    tidyselect_1.1.2  xfun_0.31         bslib_0.3.1      
 [5] purrr_0.3.4       colorspace_2.0-3  vctrs_0.4.1       generics_0.1.2   
 [9] htmltools_0.5.2   yaml_2.3.5        utf8_1.2.2        rlang_1.0.2      
[13] jquerylib_0.1.4   later_1.3.0       pillar_1.7.0      withr_2.5.0      
[17] DBI_1.1.2         glue_1.6.2        lifecycle_1.0.1   stringr_1.4.0    
[21] munsell_0.5.0     gtable_0.3.0      evaluate_0.15     labeling_0.4.2   
[25] knitr_1.39        callr_3.7.0       fastmap_1.1.0     httpuv_1.6.5     
[29] ps_1.7.0          fansi_1.0.3       highr_0.9         Rcpp_1.0.8.3     
[33] promises_1.2.0.1  scales_1.2.0      jsonlite_1.8.0    farver_2.1.0     
[37] fs_1.5.2          hms_1.1.1         digest_0.6.29     stringi_1.7.6    
[41] processx_3.5.3    dplyr_1.0.9       getPass_0.2-2     cowplot_1.1.1    
[45] rprojroot_2.0.3   grid_4.2.0        cli_3.3.0         tools_4.2.0      
[49] magrittr_2.0.3    sass_0.4.1        tibble_3.1.7      crayon_1.5.1     
[53] whisker_0.4       pkgconfig_2.0.3   ellipsis_0.3.2    prettyunits_1.1.1
[57] assertthat_0.2.1  rmarkdown_2.14    httr_1.4.3        rstudioapi_0.13  
[61] R6_2.5.1          git2r_0.30.1      compiler_4.2.0