- ICD code / PheWAS code mapping from phewascatalog (https://phewascatalog.org/phecodes and https://phewascatalog.org/phecodes_icd10)
- Collection of information about PheWAS codes and their inclusion / exclusion filters
- Collection and harmonization of ICD codes from UKB
- Extraction of all ICD codes from the available fields in your UKB baskets
- Generatation of a phenome: case control study for each phecode
- data.table
- tidyr
- parallel
- intervals
- htmltab
- bitops
Add the absolute paths (e.g. /driveA/UKB/ukb####.tab
) of your TAB-delimited UKB baskets to a single text file ./data/baskets.txt
cd createUKBphenome
Rscript ./scripts/function.createUKBphenome.r
- Full ICD / PheWAS code tables with descriptions (what's the underlying ICD code for each phecode)
- UKB phenome with exclusion criteria applied to controls
- UKB phenome without applying exclusion criteria to controls
- Overview of all phecodes, their categories and general descriptions
- Output of all ICD codes that were NOT mapped to phecodes (incl. sample sizes)
- Output of all individuals that had sex-specific diagnose codes that did not match their sex
- This script requires a ton of memory (~20-30 GB), because it reads and collects a lot of data into memory.
- This script requires ICD data of the UK Biobank (ideally the most comprehensive list),
Genetic Sex
andSex
- Only samples with
Genetic Sex
equalsSex
are kept, because it's unclear why it should be different (potential sources for mismatch: gender identity, bone marrow transplant, sample swap)