CreateUKBphenome
Create a PheWAS code based phenome using ICD9 and ICD10 data from baskets of the UK biobank
Install / Use
/learn @FritscheLab/CreateUKBphenomeREADME
createUKBphenome
Basic concepts
- 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
Required R libraries
- data.table
- tidyr
- parallel
- intervals
- htmltab
- bitops
Step 1: Describe your data
Add the absolute paths (e.g. /driveA/UKB/ukb####.tab) of your TAB-delimited UKB baskets to a single text file ./data/baskets.txt
Add the latest file with withdrawn samples 'w#####_########.csv' to './data/' folder
Step 2: Create Phenome
cd createUKBphenome
Rscript ./scripts/function.createUKBphenome.r
Output
- 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
Notes:
- 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 SexandSex - Only samples with
Genetic SexequalsSexare kept, because it's unclear why it should be different (potential sources for mismatch: gender identity, bone marrow transplant, sample swap)
Related Skills
node-connect
351.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
