Last updated: 2021-09-23

Checks: 6 1

Knit directory: proxyMR/

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.


The R Markdown is untracked by Git. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

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(20210602) 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 49723f9. 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:    proxyMR_figure_data.RData
    Ignored:    renv/library/
    Ignored:    renv/local/
    Ignored:    renv/staging/

Untracked files:
    Untracked:  R/proxyMR_figures.R
    Untracked:  R/proxyMR_hiercharchy.R
    Untracked:  analysis/project_status.Rmd
    Untracked:  analysis/update_meeting_23_09_2021.Rmd

Unstaged changes:
    Modified:   _targets.R
    Modified:   analysis/index.Rmd
    Modified:   analysis/todo_list.Rmd

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.


There are no past versions. Publish this analysis with wflow_publish() to start tracking its development.


1 Last meeting summary.

  • Because the results comparing \(\omega\) to \(\rho + \gamma\) were slightly confusing (see last meeting summary here), decided we should explore the impact of \(X_i\) on the \(Y_i \rightarrow Y_p\) causal effects.

Version Author Date
fda4843 jennysjaarda 2021-09-14
  • Two ideas:
    1. Identify overlap between \(X_i \rightarrow X_p\) IVs and \(Y_i \rightarrow Y_p\).
    2. Adjust the \(Y_i \rightarrow Y_p\) MR results for effects of \(X_i\) (as depicted below).

2 Results.

2.1 Overlap between IVs for \(X\) and \(Y\).

  • Is simply calculating the SNP overlap good enough?
  • Better to calculate signal overlap using LD at some \(r^2\) cutoff (what threshold would be useful?).
    • For each IV used to estimate the causal effect \(Y_i \rightarrow Y_p\),
    • Test if they are in LD with any IV used to estimate the causal effect \(X_i \rightarrow X_p\) at \(r^2\) > 0.9,
    • Repeat for all IVs for \(Y_i\) to calcualte the percentage overlap between the two sets of IVs.
    • Define percentage overlap as: (# of \(Y_i\) IVs are in LD with at least one \(X_i\) IV at \(r^2\) > 0.9) / (total number of \(Y_i\) IVs used).

The results can be seen below. The YiXi_IV_exact_overlap column indicates the percentage of \(Y_i\) IVs that are an exact match with \(X_i\) IVs (same rs#). The YiXi_IV_sig_overlap column denotes the percentage overlap of signals, as defined above.

The results with the most overlap involve traits that are nearly identical.

2.2 Adjust \(Y_i \rightarrow Y_p\).

Performed MV MR \(Y_i \rightarrow Y_p\) relationships: \(Y_p \sim Y_i + X_i\). Where IVs were the same as the two trait MR (\(Y_p \sim Y_i\)) based on \(Y\), but the effect of the IVs on \(X_i\) were also included in the model.

2.3 Updated results with adjusted \(Y_i\)


sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Big Sur 11.5.2

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8

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

other attached packages:
 [1] knitr_1.33      DT_0.18         targets_0.7.0   forcats_0.5.1  
 [5] stringr_1.4.0   dplyr_1.0.7     purrr_0.3.4     readr_2.0.1    
 [9] tidyr_1.1.3     tibble_3.1.2    ggplot2_3.3.5   tidyverse_1.3.1

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.7        lubridate_1.7.10  ps_1.6.0          assertthat_0.2.1 
 [5] rprojroot_2.0.2   digest_0.6.27     utf8_1.2.1        R6_2.5.0         
 [9] cellranger_1.1.0  backports_1.2.1   reprex_2.0.0      evaluate_0.14    
[13] highr_0.9         httr_1.4.2        pillar_1.6.1      rlang_0.4.11     
[17] readxl_1.3.1      data.table_1.14.0 rstudioapi_0.13   whisker_0.4      
[21] callr_3.7.0       rmarkdown_2.10    htmlwidgets_1.5.3 igraph_1.2.6     
[25] munsell_0.5.0     broom_0.7.6       compiler_4.1.0    httpuv_1.6.1     
[29] modelr_0.1.8      xfun_0.23         pkgconfig_2.0.3   htmltools_0.5.1.1
[33] tidyselect_1.1.1  workflowr_1.6.2   codetools_0.2-18  fansi_0.5.0      
[37] crayon_1.4.1      tzdb_0.1.2        dbplyr_2.1.1      withr_2.4.2      
[41] later_1.2.0       grid_4.1.0        jsonlite_1.7.2    gtable_0.3.0     
[45] lifecycle_1.0.0   DBI_1.1.1         git2r_0.28.0      magrittr_2.0.1   
[49] scales_1.1.1      cli_2.5.0         stringi_1.6.2     fs_1.5.0         
[53] promises_1.2.0.1  xml2_1.3.2        ellipsis_0.3.2    generics_0.1.0   
[57] vctrs_0.3.8       tools_4.1.0       glue_1.4.2        hms_1.1.0        
[61] processx_3.5.2    yaml_2.2.1        colorspace_2.0-1  rvest_1.0.0      
[65] haven_2.4.1