Last updated: 2022-02-22

Checks: 5 2

Knit directory: codemapper/

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.

The global environment had objects present when the code in the R Markdown file was run. These objects 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. Use wflow_publish or wflow_build to ensure that the code is always run in an empty environment.

The following objects were defined in the global environment when these results were created:

Name Class Size
install_codemapper function 1.2 Kb

The command set.seed(20210923) 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.

Using absolute paths to the files within your workflowr project makes it difficult for you and others to run your code on a different machine. Change the absolute path(s) below to the suggested relative path(s) to make your code more reproducible.

absolute relative
~/Documents/PhDLocal/codemapper/ukbb_pan_ancestry-master/data/UKB_PHENOME_ICD9_PHECODE_MAP_20200109.txt ukbb_pan_ancestry-master/data/UKB_PHENOME_ICD9_PHECODE_MAP_20200109.txt
~/Documents/PhDLocal/codemapper/ukbb_pan_ancestry-master/data/UKB_PHENOME_ICD10_PHECODE_MAP_20200109.txt ukbb_pan_ancestry-master/data/UKB_PHENOME_ICD10_PHECODE_MAP_20200109.txt

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 a42dc66. 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:    .Renviron
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    _targets/
    Ignored:    all_lkps_maps.db
    Ignored:    renv/library/
    Ignored:    renv/staging/
    Ignored:    tar_make.R
    Ignored:    ukbb_pan_ancestry-master/

Unstaged changes:
    Modified:   R/utils.R
    Modified:   analysis/read3_icd10_mapping.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.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/phecodes.Rmd) and HTML (public/phecodes.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
html d777258 Chuin Ying Ung 2022-02-22 merge with dev_cy branch
html 1df97df rmgpanw 2022-02-17 incorporate icd9 and icd10 to phecode maps
html 81047b4 rmgpanw 2022-02-17 setup for gitlab CI with pkgdown site and test coverage; start adding read3 to snomed mapping
Rmd 1535c93 Chuin Ying Ung 2022-02-17 updated notes
html 1535c93 Chuin Ying Ung 2022-02-17 updated notes
Rmd 5c2a3e3 Chuin Ying Ung 2022-02-17 update _targets.R (housekeeping) and phecode.Rmd
html 5c2a3e3 Chuin Ying Ung 2022-02-17 update _targets.R (housekeeping) and phecode.Rmd
Rmd 8d14804 Chuin Ying Ung 2022-02-17 add phecode.Rmd

Overview

Aim: to explore the phecode lookup and mapping files.

Background - phecodes

PheWAS R package

Generate some example data

#Create the phecode table- translates the codes, adds exclusions, and reshapes to a wide format. #Sum up the counts in the data where applicable.

#Combine the data

#Run the PheWAS

#Plot the results

Version Author Date
1535c93 Chuin Ying Ung 2022-02-17

#Add PheWAS descriptions

#List the top 10 results

     phenotype       snp covariates       beta         SE        OR
549        335 rsEXAMPLE        sex  0.3967548 0.06684421 1.4869913
431      288.2 rsEXAMPLE        sex  1.3847304 0.38379930 3.9937489
507      315.1 rsEXAMPLE        sex  1.4280228 0.41430554 4.1704451
1475     716.8 rsEXAMPLE        sex  1.3794156 0.40731579 3.9725795
1686     798.1 rsEXAMPLE        sex  1.0432921 0.30938935 2.8385463
743      401.2 rsEXAMPLE        sex  0.8005488 0.24653912 2.2267626
1002     525.1 rsEXAMPLE        sex  0.9682267 0.29931207 2.6332707
680      375.1 rsEXAMPLE        sex -1.2438354 0.38503286 0.2882764
838      440.2 rsEXAMPLE        sex  0.6394982 0.20822694 1.8955294
744     401.21 rsEXAMPLE        sex  1.2694273 0.41871628 3.5588138
                p     type n_total n_cases n_controls HWE_p allele_freq
549  2.929243e-09 logistic    4404    1873       2531     1   0.5128292
431  3.086207e-04 logistic    4731      26       4705     1   0.5110970
507  5.672965e-04 logistic    4762      22       4740     1   0.5115498
1475 7.076450e-04 logistic    4243      23       4220     1   0.5103700
1686 7.459717e-04 logistic    4973      42       4931     1   0.5115624
743  1.165681e-03 logistic    4924      70       4854     1   0.5111698
1002 1.217109e-03 logistic    4284      46       4238     1   0.5109711
680  1.235888e-03 logistic    4501      27       4474     1   0.5118862
838  2.132291e-03 logistic    4108     102       4006     1   0.5139971
744  2.431709e-03 logistic    4876      22       4854     1   0.5105619
     n_no_snp                        formula               expanded_formula
549         0    `335` ~ `rsEXAMPLE` + `sex` (Intercept) + rsEXAMPLE + sexM
431         0  `288.2` ~ `rsEXAMPLE` + `sex` (Intercept) + rsEXAMPLE + sexM
507         0  `315.1` ~ `rsEXAMPLE` + `sex` (Intercept) + rsEXAMPLE + sexM
1475        0  `716.8` ~ `rsEXAMPLE` + `sex` (Intercept) + rsEXAMPLE + sexM
1686        0  `798.1` ~ `rsEXAMPLE` + `sex` (Intercept) + rsEXAMPLE + sexM
743         0  `401.2` ~ `rsEXAMPLE` + `sex` (Intercept) + rsEXAMPLE + sexM
1002        0  `525.1` ~ `rsEXAMPLE` + `sex` (Intercept) + rsEXAMPLE + sexM
680         0  `375.1` ~ `rsEXAMPLE` + `sex` (Intercept) + rsEXAMPLE + sexM
838         0  `440.2` ~ `rsEXAMPLE` + `sex` (Intercept) + rsEXAMPLE + sexM
744         0 `401.21` ~ `rsEXAMPLE` + `sex` (Intercept) + rsEXAMPLE + sexM
     note                             description              group
549                            Multiple sclerosis       neurological
431               Elevated white blood cell count      hematopoietic
507                             Learning disorder   mental disorders
1475                       Palindromic rheumatism    musculoskeletal
1686                     Chronic fatigue syndrome           symptoms
743       Hypertensive heart and/or renal disease circulatory system
1002                  Loss of teeth or edentulism          digestive
680                                      Dry eyes       sense organs
838            Atherosclerosis of the extremities circulatory system
744                    Hypertensive heart disease circulatory system

#Create a nice interactive table (eg, in RStudio)

Mapping files

Version Author Date
1535c93 Chuin Ying Ung 2022-02-17

Version Author Date
1535c93 Chuin Ying Ung 2022-02-17
[1] 7017
[1] 1004
[1] 6917
[1] 2772

R version 4.1.2 (2021-11-01)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.2

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

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

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

other attached packages:
 [1] PheWAS_0.99.5-5       ggVennDiagram_1.2.0   codemapper_0.0.0.9000
 [4] ukbwranglr_0.0.0.9000 targets_0.8.0         crosstalk_1.1.1      
 [7] readxl_1.3.1          reactable_0.2.3       forcats_0.5.1        
[10] stringr_1.4.0         dplyr_1.0.7           purrr_0.3.4          
[13] readr_2.0.2           tidyr_1.1.4           tibble_3.1.4         
[16] ggplot2_3.3.5         tidyverse_1.3.1       workflowr_1.6.2      

loaded via a namespace (and not attached):
  [1] minqa_1.2.4          colorspace_2.0-2     class_7.3-20        
  [4] ellipsis_0.3.2       rprojroot_2.0.2      fs_1.5.0            
  [7] proxy_0.4-26         rstudioapi_0.13      mice_3.14.0         
 [10] farver_2.1.0         bit64_4.0.5          ggrepel_0.9.1       
 [13] DT_0.20              fansi_0.5.0          lubridate_1.7.10    
 [16] mathjaxr_1.4-0       xml2_1.3.2           codetools_0.2-18    
 [19] splines_4.1.2        knitr_1.34           jsonlite_1.7.2      
 [22] nloptr_2.0.0         logistf_1.24.1       broom_0.7.9         
 [25] dbplyr_2.1.1         shiny_1.7.0          compiler_4.1.2      
 [28] httr_1.4.2           backports_1.2.1      assertthat_0.2.1    
 [31] Matrix_1.3-3         fastmap_1.1.0        cli_3.0.1           
 [34] later_1.3.0          htmltools_0.5.2      tools_4.1.2         
 [37] igraph_1.2.6         gtable_0.3.0         glue_1.4.2          
 [40] Rcpp_1.0.7           cellranger_1.1.0     jquerylib_0.1.4     
 [43] vctrs_0.3.8          nlme_3.1-152         lmtest_0.9-39       
 [46] xfun_0.24            ps_1.6.0             lme4_1.1-28         
 [49] rvest_1.0.1          mime_0.12            CompQuadForm_1.4.3  
 [52] lifecycle_1.0.1      renv_0.13.2          formula.tools_1.7.1 
 [55] zoo_1.8-9            MASS_7.3-54          scales_1.1.1        
 [58] vroom_1.5.5          hms_1.1.1            promises_1.2.0.1    
 [61] meta_5.2-0           metafor_3.0-2        yaml_2.2.1          
 [64] sass_0.4.0           stringi_1.7.4        highr_0.9           
 [67] e1071_1.7-9          boot_1.3-28          operator.tools_1.6.3
 [70] rlang_0.4.11         pkgconfig_2.0.3      evaluate_0.14       
 [73] lattice_0.20-44      sf_1.0-6             labeling_0.4.2      
 [76] htmlwidgets_1.5.4    bit_4.0.4            processx_3.5.2      
 [79] tidyselect_1.1.1     magrittr_2.0.1       R6_2.5.1            
 [82] generics_0.1.0       DBI_1.1.1            pillar_1.6.3        
 [85] haven_2.4.3          whisker_0.4          withr_2.4.2         
 [88] mgcv_1.8-35          units_0.8-0          survival_3.2-13     
 [91] modelr_0.1.8         crayon_1.4.1         KernSmooth_2.23-20  
 [94] utf8_1.2.2           RVenn_1.1.0          tzdb_0.1.2          
 [97] rmarkdown_2.11       grid_4.1.2           data.table_1.14.2   
[100] reactR_0.4.4         callr_3.7.0          git2r_0.28.0        
[103] classInt_0.4-3       reprex_2.0.1         digest_0.6.28       
[106] xtable_1.8-4         httpuv_1.6.3         munsell_0.5.0       
[109] bslib_0.3.0