Last updated: 2021-06-18

Checks: 7 0

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.


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(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 14a8a7a. 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:    renv/library/
    Ignored:    renv/local/
    Ignored:    renv/staging/

Untracked files:
    Untracked:  summary.RData

Unstaged changes:
    Modified:   R/functions.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 repository in which changes were made to the R Markdown (analysis/update_meeting_14_06_2021.Rmd) and HTML (docs/update_meeting_14_06_2021.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 14a8a7a jennysjaarda 2021-06-18 wflow_publish(c(“analysis/index.Rmd”, “analysis/update_meeting_14_06_2021.Rmd”))
html b02d111 jennysjaarda 2021-06-18 Build site.
Rmd dfe878d jennysjaarda 2021-06-18 wflow_publish(c(“analysis/index.Rmd”, “analysis/update_meeting_14_06_2021.Rmd”))
Rmd 750d442 jennysjaarda 2021-06-16 add website docs
html 750d442 jennysjaarda 2021-06-16 add website docs

Last week summary.

Next steps:

  1. Summarize all our results to get a feel for top traits (let’s call this: trait/trait MR). A logical addition that we didn’t discuss would be to meta-analyze across sexes and see what traits are significant in pooled analysis and then check which of these are significantly different between sexes.

  2. Test linear association across bins (both age and time-together bins) using IVW estimated inversely weighted by SE.

  3. Combine age and time-together bins into a grid of effect sizes to see if we see any pattern.

  4. Move beyond our trait/trait MR into investigating how one trait impacts other traits to tease out direct vs indirect effects, two parts here:

    1. as univariate model and
    2. as multivariate model (selecting traits for multivariate model that were nominal in univariate).
  5. Replicate permutation procedure from Tenesa paper. Do you still want to explore this?

  6. Explore dietary traits - request estimates from Ninon?

Follow-up questions:

Re (#4), for the trait/trait MR, I essentially followed a 2-sample MR procedure (just as a refresher for us both), so for example BMI partner vs BMI trait:

  • Find IVs for BMI in Neale and take these estimates as betaX.
  • Test association of IVs with partner BMI in couples (this is betaY).
  • Combine effects together in standard MR framework (betaY ~ betaX).

For the univariate analysis between two traits, I think what you were suggesting is to follow exactly the same procedure as above. So for example, disease partner vs BMI trait:

  • Same IVs as above and take these estimates as betaX.
  • Test association of these IVs with partner “different phenotype” (some disease, let’s say) (betaY).
  • Combine in MR framework.

For the multivariate model, so if the model of interest is BMI ~ BMI + education + diet + activity level:

  • IVs are the union of the IVs for each individual trait (estimates taken from Neale: beta_BMI, beta_edu, beta_diet).
  • Additional step: prune these SNPs to ensure independence.
  • Test association of these pruned SNPs with BMI in couples (betaY).
  • Combine effects in multivariate MR framework: betaY ~ beta_BMI + beta_edu + beta_diet, etc…

Does this look right (particularly for the multivariate model)? i.e. the final MR model only includes beta estimates, no raw genetic data.

I also understood that one of the traits to explore would be PCs. To me it seems logical that this would be a causal variable to explore (for eg, an MR being: BMI_beta ~ PCX_beta) rather than the other way around. If I have that right, then that means we would need IVs for PCs. At quick glance, Neale doesn’t have this available. Do you know if anyone in the group would have done this, otherwise I should run this GWAS.

Responses:

  • Re. #3: also test heterogeneity (in case there is discrepancy, but no trend), using Cochran’s Q stat.
  • Re. combining time-together and age bins: Do this only if the previous point gave something promising. Otherwise drop it.
  • Not urgent to replicate Tenesa paper.
  • To explore dietary traits, got in touch again with Nicola Pirastu.
  • Raw genetic data is only used to derive the betaY, but from then it is a 2-sample MR.
  • PCs are only exposures, not outcomes. Need to run GWAS.

Results.

Traits analyzed.

Summary of results

  • IVW estimates report sex-specific results
  • MR_meta statistics refer to the meta of both-sexes combined.
  • Sex heterogeneity column reports the p-value of the difference between the MR estimates from the two sexes.

Testing discrepancy amongst bins.

  • The first table represents the results of individuals binned by average age.
  • The second table represent the results of individuals binned by time together.
  • Q p-values report the difference amongst bins.

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

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 datasets  utils     methods   base     

other attached packages:
[1] knitr_1.33         DT_0.18            targets_0.5.0.9000 workflowr_1.6.2   

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6        git2r_0.28.0      pillar_1.6.1      compiler_4.1.0   
 [5] later_1.2.0       tools_4.1.0       digest_0.6.27     jsonlite_1.7.2   
 [9] evaluate_0.14     lifecycle_1.0.0   tibble_3.1.2      pkgconfig_2.0.3  
[13] rlang_0.4.11      igraph_1.2.6      DBI_1.1.1         cli_2.5.0        
[17] crosstalk_1.1.1   yaml_2.2.1        xfun_0.23         dplyr_1.0.6      
[21] withr_2.4.2       stringr_1.4.0     generics_0.1.0    htmlwidgets_1.5.3
[25] fs_1.5.0          vctrs_0.3.8       rprojroot_2.0.2   tidyselect_1.1.1 
[29] glue_1.4.2        data.table_1.14.0 R6_2.5.0          processx_3.5.2   
[33] fansi_0.5.0       rmarkdown_2.8     whisker_0.4       callr_3.7.0      
[37] purrr_0.3.4       magrittr_2.0.1    ps_1.6.0          promises_1.2.0.1 
[41] codetools_0.2-18  ellipsis_0.3.2    htmltools_0.5.1.1 assertthat_0.2.1 
[45] renv_0.13.2-62    httpuv_1.6.1      utf8_1.2.1        stringi_1.6.2    
[49] crayon_1.4.1