Last updated: 2022-06-14

Checks: 5 2

Knit directory: codemapper_notes/

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.


The R Markdown file has unstaged changes. 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.

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.

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 195150a. 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/meta/process
    Ignored:    _targets/meta/progress
    Ignored:    _targets/objects/
    Ignored:    _targets/user/
    Ignored:    all_lkps_maps.db
    Ignored:    renv/library/
    Ignored:    renv/staging/
    Ignored:    tar_make.R

Untracked files:
    Untracked:  analysis/ukb_self_report_non_cancer_illness_caliber_mapping.Rmd
    Untracked:  analysis/ukb_self_report_operations_caliber_mapping.Rmd
    Untracked:  data_small/ukb_self_report_operations_to_caliber_map.csv
    Untracked:  data_small/ukb_self_report_operations_to_caliber_map_raw.csv

Unstaged changes:
    Modified:   _targets.R
    Modified:   _targets/meta/meta
    Modified:   analysis/index.Rmd
    Deleted:    analysis/ukb_self_report_caliber_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/index.Rmd) and HTML (public/index.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 195150a rmgpanw 2022-06-13 added notes on mapping ukb self-reported codes to CALIBER diseases
html 195150a rmgpanw 2022-06-13 added notes on mapping ukb self-reported codes to CALIBER diseases
html 837a6e4 rmgpanw 2022-06-10 add read3_icd10 mapping notes (element/block_num); rerun pipeline with most uptodate ukbwranglr/codemapper versions (and update renv.lock)
Rmd c7c2ef1 rmgpanw 2022-04-28 minor updates to about/index/license.Rmds
html c7c2ef1 rmgpanw 2022-04-28 minor updates to about/index/license.Rmds
Rmd 92339ca rmgpanw 2022-04-28 various code tweaks; rerun targets pipeline
html 92339ca rmgpanw 2022-04-28 various code tweaks; rerun targets pipeline
Rmd f76d57e rmgpanw 2022-04-27 remove r package files/directories (now in separate codemapper github repo: https://rmgpanw.github.io/codemapper/)
Rmd 98b0efc rmgpanw 2022-03-16 update rmd files
html 98b0efc rmgpanw 2022-03-16 update rmd files
Rmd 193f2cb rmgpanw 2022-03-16 add notes re icd9-10 mapping, and reformatting function for ths mapping table
html 193f2cb rmgpanw 2022-03-16 add notes re icd9-10 mapping, and reformatting function for ths mapping table
Rmd 84beb4f rmgpanw 2022-03-16 update notes on read to icd10 mapping
html 84beb4f rmgpanw 2022-03-16 update notes on read to icd10 mapping
Rmd e5c5381 rmgpanw 2022-03-10 update mainly icd10-related codes.
Rmd a64a35e rmgpanw 2022-03-10 change arg quiet = TRUE to unrecognised_codes = "error". Also updated tests (passing)
Rmd dfbc621 Chuin Ying Ung 2022-02-22 add mapping notes
html dfbc621 Chuin Ying Ung 2022-02-22 add mapping notes
html d777258 Chuin Ying Ung 2022-02-22 merge with dev_cy branch
Rmd 5b80a79 Chuin Ying Ung 2022-02-22 update notes
html 5b80a79 Chuin Ying Ung 2022-02-22 update notes
html 81047b4 rmgpanw 2022-02-17 setup for gitlab CI with pkgdown site and test coverage; start adding read3 to snomed mapping
html 5c2a3e3 Chuin Ying Ung 2022-02-17 update _targets.R (housekeeping) and phecode.Rmd
Rmd 919be0d rmgpanw 2021-10-07 renamed functions and made shiny app for selecting codes
html 919be0d rmgpanw 2021-10-07 renamed functions and made shiny app for selecting codes
Rmd 3fe5ae7 rmgpanw 2021-09-23 initial commit

library(tidyverse)
library(targets)

Notes on adapting raw lookup and mapping tables for codemapper (see also pkgdown site)

Lookup tables

Mapping tables

Work in progress

Setup

Specify the location of required raw data files in a .Renviron file in the root directory of this project:

tar_read(RENVIRON) %>%
  readLines() %>%
  purrr::map_chr( ~ stringr::str_replace(
    string = .x,
    pattern = "=.*$",
    replacement = "="
  )) %>%
  stringr::str_c(sep = "",
                 collapse = "\n") %>%
  cat()
########################################
#         RAW INPUT FILES              #
########################################
# UKB resources
## UKB resource 592 ('all_lkps_maps_v3.xlsx') - download from https://biobank.ndph.ox.ac.uk/ukb/refer.cgi?id=
ALL_LKPS_MAPS_XLSX=

## TRUD - Read 3 to SNOMED map
CTV3SCTMAP2=

## PheWAS - download from https://phewascatalog.org/ (`phecode_definitions1.2.csv.zip`, `Phecode_map_v1_2_icd10_beta.csv.zip` and `phecode_icd9_map_unrolled.csv.zip`)
PHECODE_1_2_LKP=
PHECODE_1_2_ICD10_MAP=
PHECODE_1_2_ICD9_MAP=

## Local copy of CALIBER github repo
CALIBER_LOCAL=

########################################
#         OUTPUT FILES                 #
########################################
# UKB resource 592
ALL_LKPS_MAPS_DB_PATH=

sessionInfo()
R version 4.2.0 (2022-04-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur/Monterey 10.16

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/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] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
 [1] targets_0.12.0  forcats_0.5.1   stringr_1.4.0   dplyr_1.0.9    
 [5] purrr_0.3.4     readr_2.1.2     tidyr_1.2.0     tibble_3.1.7   
 [9] ggplot2_3.3.5   tidyverse_1.3.1 workflowr_1.7.0

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.8.3      lubridate_1.8.0   getPass_0.2-2     ps_1.7.0         
 [5] assertthat_0.2.1  rprojroot_2.0.3   digest_0.6.29     utf8_1.2.2       
 [9] cellranger_1.1.0  R6_2.5.1          backports_1.4.1   reprex_2.0.1     
[13] evaluate_0.15     httr_1.4.2        highr_0.9         pillar_1.7.0     
[17] rlang_1.0.2       readxl_1.4.0      data.table_1.14.2 rstudioapi_0.13  
[21] whisker_0.4       callr_3.7.0       jquerylib_0.1.4   rmarkdown_2.14   
[25] igraph_1.3.1      munsell_0.5.0     broom_0.8.0       compiler_4.2.0   
[29] httpuv_1.6.5      modelr_0.1.8      xfun_0.30         pkgconfig_2.0.3  
[33] htmltools_0.5.2   tidyselect_1.1.2  codetools_0.2-18  fansi_1.0.3      
[37] withr_2.5.0       crayon_1.5.1      tzdb_0.3.0        dbplyr_2.2.0     
[41] later_1.3.0       grid_4.2.0        jsonlite_1.8.0    gtable_0.3.0     
[45] lifecycle_1.0.1   DBI_1.1.2         git2r_0.30.1      magrittr_2.0.3   
[49] scales_1.2.0      cli_3.3.0         stringi_1.7.6     renv_0.13.2      
[53] fs_1.5.2          promises_1.2.0.1  xml2_1.3.3        bslib_0.3.1      
[57] ellipsis_0.3.2    generics_0.1.2    vctrs_0.4.1       tools_4.2.0      
[61] glue_1.6.2        hms_1.1.1         processx_3.5.3    fastmap_1.1.0    
[65] yaml_2.3.5        colorspace_2.0-3  base64url_1.4     rvest_1.0.2      
[69] knitr_1.39        haven_2.5.0       sass_0.4.1