Last updated: 2025-10-08
Checks: 7 0
Knit directory:
genomics_ancest_disease_dispar/
This reproducible R Markdown analysis was created with workflowr (version 1.7.1). 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(20220216) 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 03c72b3. 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: .Rproj.user/
Ignored: analysis/.DS_Store
Ignored: data/.DS_Store
Ignored: data/gbd/.DS_Store
Ignored: data/gbd/IHME-GBD_2021_DATA-d8cf695e-1.csv
Ignored: data/gbd/ihme_gbd_2019_global_disease_burden_rate_all_ages.csv
Ignored: data/gbd/ihme_gbd_2019_global_paf_rate_percent_all_ages.csv
Ignored: data/gbd/ihme_gbd_2021_global_disease_burden_rate_all_ages.csv
Ignored: data/gbd/ihme_gbd_2021_global_paf_rate_percent_all_ages.csv
Ignored: data/gwas_catalog/
Ignored: data/icd/.DS_Store
Ignored: data/icd/IHME_GBD_2019_COD_CAUSE_ICD_CODE_MAP_Y2020M10D15.XLSX
Ignored: data/icd/IHME_GBD_2019_NONFATAL_CAUSE_ICD_CODE_MAP_Y2020M10D15.XLSX
Ignored: data/icd/IHME_GBD_2021_COD_CAUSE_ICD_CODE_MAP_Y2024M05D16.XLSX
Ignored: data/icd/IHME_GBD_2021_NONFATAL_CAUSE_ICD_CODE_MAP_Y2024M05D16.XLSX
Ignored: data/icd/UK_Biobank_master_file.tsv
Ignored: data/icd/cdc_valid_icd10_Sep_23_2025.xlsx
Ignored: data/icd/cdc_valid_icd9_Sep_23_2025.xlsx
Ignored: data/icd/manual_disease_icd10_mappings.xlsx
Ignored: data/icd/phecode_international_version_unrolled.csv
Ignored: data/icd/semiautomatic_ICD-pheno.txt
Ignored: data/icd/~$IHME_GBD_2019_COD_CAUSE_ICD_CODE_MAP_Y2020M10D15.XLSX
Ignored: data/icd/~$IHME_GBD_2019_NONFATAL_CAUSE_ICD_CODE_MAP_Y2020M10D15.XLSX
Ignored: data/who/
Ignored: output/.DS_Store
Ignored: output/gwas_cat/
Ignored: output/gwas_study_info_cohort_corrected.csv
Ignored: output/gwas_study_info_trait_corrected.csv
Ignored: output/gwas_study_info_trait_ontology_info.csv
Ignored: output/gwas_study_info_trait_ontology_info_l1.csv
Ignored: output/gwas_study_info_trait_ontology_info_l2.csv
Ignored: output/icd_map/
Ignored: output/trait_ontology/
Ignored: renv/
Ignored: sup_table.xlsx
Untracked files:
Untracked: analysis/gwas_to_gbd.Rmd
Unstaged changes:
Modified: analysis/disease_inves_by_ancest.Rmd
Modified: analysis/gbd_data_plots.Rmd
Modified: analysis/index.Rmd
Modified: analysis/level_1_disease_group_non_cancer.Rmd
Modified: analysis/level_2_disease_group.Rmd
Modified: analysis/map_trait_to_icd10.Rmd
Modified: analysis/trait_ontology_categorization.Rmd
Modified: data/icd/README.md
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/manual_trait_map_icd10.Rmd) and HTML
(docs/manual_trait_map_icd10.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 | 03c72b3 | IJbeasley | 2025-10-08 | Update manual map for infectious diseases |
| html | b0ddf02 | IJbeasley | 2025-10-03 | Build site. |
| Rmd | aa392ec | IJbeasley | 2025-10-03 | Add more descriptions to manual icd 10 mapping |
| html | f51b5d2 | IJbeasley | 2025-10-03 | Build site. |
| Rmd | 5ecfa08 | IJbeasley | 2025-10-03 | Create manual icd 10 mapping |
library(data.table)
library(dplyr)
library(stringr)
# phecode to ICD10 mapping from https://wei-lab.app.vumc.org/phecode-data/phecode_international_version
phecodes <- fread(here::here("data/icd/phecode_international_version_unrolled.csv"))
Manual mapping completed using: WHO ICD-10 2019 https://icd.who.int/browse10/2019
collected_all_disease_terms = c("alcoholic liver cirrhosis",
"alcoholic pancreatitis",
"ischemic cardiomyopathy",
"systemic juvenile idiopathic arthritis",
"juvenile idiopathic arthritis",
"oligoarticular juvenile idiopathic arthritis",
"sapho syndrome",
"synovial plica syndrome",
"urgency urinary incontinence",
"abdominal distention",
"early-onset alzheimers disease",
"late-onset alzheimers disease",
"renal overload-type gout",
"vomiting of pregnancy",
"kleine-levin syndrome",
"autoimmune pancreatitis type 1",
"allergic contact dermatitis of eyelid",
"guillain-barre syndrome",
"idiopathic pulmonary fibrosis",
"behcets syndrome",
"kashin-beck disease",
"chronic thromboembolic pulmonary hypertension",
"pulmonary hypertension",
"pulmonary arterial hypertension",
"pulmonary coin lesion",
"pulmonary infarction",
"neuromyelitis optica",
"buruli ulcer disease",
"churg-strauss syndrome",
"graft versus host disease",
"takayasu arteritis",
"enuresis",
"cannabis dependence",
"orofacial cleft",
"eczema",
"drug dependence",
"cocaine-related disorders",
"pharynx cancer",
"pseudotumor cerebri",
"altitude sickness",
"high altitude pulmonary edema",
"intrahepatic cholestasis of pregnancy",
"brain injury",
"radiation-induced brain injury",
"abdominal infections code",
"secondary hyperparathyroidism of renal origin",
"gastroparesis",
"neuroblastoma",
"peripartum cardiomyopathy",
"retroperitoneal cancer",
"asphyxia neonatorum",
"postherpetic neuralgia",
"manic or hypomanic episode",
"allergic conjunctivitis",
"thiazide-induced hyponatremia",
"alpha 1-antitrypsin deficiency",
"autoimmune thyroid disease",
"hashimotos thyroiditis",
"charcot-marie-tooth disease type 1a",
"amyotrophic lateral sclerosis",
"fuchs endothelial corneal dystrophy",
"duchenne muscular dystrophy",
"familial apolipoprotein b hypobetalipoproteinemia",
"gastric metaplasia",
"inborn carbohydrate metabolic disorder",
"petaloid toenail",
"thyrotoxic periodic paralysis",
"schizoaffective disorder",
"rhegmatogenous retinal detachment",
"restless legs syndrome",
"preterm premature rupture of the membranes",
"porphyrin metabolism disease",
"peritoneal cancer",
"methamphetamine use disorders",
"familial sick sinus syndrome",
"drug misuse",
"abnormal ecg",
"adenoiditis",
"bacterial endocarditis",
"biliary atresia",
"bronchopulmonary dysplasia",
"cervical ectropion",
"chronic primary adrenal insufficiency",
"ciliopathy",
"collagenous colitis",
"colonic diverticula",
"craniofacial microsomia",
"cryptorchidism",
"plantar fasciitis",
"plantar fibromatosis",
"lewy body dementia",
"x-linked dystonia-parkinsonism",
"hippocampal sclerosis of aging",
"testicular dysgenesis syndrome",
"internet addiction disorder",
"food addiction",
"malignant lymphoid tumor",
"compartment syndrome",
"elevated lactate dehydrogenase",
"loss of consciousness",
"nephrosclerosis",
"periprosthetic osteolysis",
"polypoidal choroidal vasculopathy",
"pulmonary alveolar proteinosis",
"chorioamnionitis",
"hoarding disorder",
"unilateral renal agenesis",
"muscle spasm",
"oral ulcer",
"ileocolitis",
"microscopic colitis",
"lymphocytic colitis",
"drug-induced dyskinesia",
"plasma protein metabolism disease",
"oral lichen planus",
"epididymitis",
"orchitis",
"ectropion",
"entropion",
"cervical dystonia",
"clonal hematopoiesis",
"diffuse idiopathic skeletal hyperostosis",
"endocervicitis",
"eosinophilic esophagitis",
"focal segmental glomerulosclerosis",
"hypercalcemia",
"hypertriglyceridemia",
"hypocalcemia",
"lymphangioleiomyomatosis",
"mononucleosis",
"necrotizing enterocolitis",
"occupation-related stress disorder",
"ototoxicity",
"plantar warts",
"podoconiosis",
"posterior cortical atrophy",
"pigment dispersion syndrome",
"takotsubo cardiomyopathy",
"testicular germ cell tumor",
"normal pressure hydrocephalus",
"anti-nmda receptor encephalitis",
"type 2 diabetes with foot ulcer",
"type 1 diabetes with foot ulcer",
"irritability",
"aggressive behavior",
"agitation",
"polycystic kidney disease",
"tendinitis",
"synovial plica syndrome",
"sapho syndrome",
"abdominal distention",
"intracranial artery stenosis",
"coronary restenosis",
"stable angina",
"acute ischemic heart disease",
"aortic valve stenosis",
"aortic valve calcification",
"mitral annular calcification",
"abdominal aortic artery calcification",
"carotid atherosclerosis",
"treatment resistant depression",
"chronic lung disease",
"hematochezia",
"nonalcoholic steatohepatitis",
"lachrymal gland lesion",
"neonatal sepsis",
"pancytopenia",
"septic shock",
"sporadic amyotrophic lateral sclerosis",
"primary thrombophilia",
"velopharyngeal dysfunction",
"systemic mastocytosis",
"sexual dysfunction",
"acute-on-chronic liver failure",
"blister",
"disorders of lipid metabolism",
"acute lung injury",
"acute respiratory distress syndrome",
"airway hyperresponsiveness",
"alagille syndrome",
"ankle injury",
"aortic disease",
"arterial thrombosis",
"carotid artery disease",
"other cancer",
"type 1 diabetes with diabetic neuropathy",
"type 2 diabetes with diabetic neuropathy",
"spine osteoarthritis",
"postpartum depression",
"rare dyslipidemia",
"orthopnea",
"macroscopic hematuria",
"hypogonadism",
"muscle weakness",
"myxedema",
"bowing of the legs",
"severe acute respiratory syndrome",
"medulloblastoma",
"sarcopenia",
"coronary thrombosis",
"cutaneous mastocytosis",
"superficial thrombophlebitis",
"ketonuria",
"papillitis",
"hyperbilirubinemia",
"parenchymal hematoma",
"coronary stenosis",
"xerostomia",
"hyponatremia",
"pigmentary iris degeneration",
"incisional hernia",
"inclusion body myositis",
"posterior urethral valve",
"fibromuscular dysplasia",
"zika virus congenital syndrome",
"hypocholesterolemia",
"small intestine enteropathy",
"cerebral small vessel disease",
"intracranial germ cell tumor",
"isolated dystonia",
"cytomegalovirus virus reactivation",
"astroviridae infectious disease",
"infantile diarrhea",
"pulmonary non-tuberculous mycobacterial infection",
"elevated lactate dehydrogenase",
"insulin resistance",
"muscle tissue disorder",
"fungal lung infectious disease",
"chorioretinitis",
"sudden death",
"bone marrow failure syndrome",
"autoimmune disorder of musculoskeletal system",
"chronic venous hypertension",
"facial pain",
"failure to thrive",
"hereditary hemochromatosis",
"lower limb asymmetry",
"metabolic syndrome x",
"mucositis",
"brain compression",
"abnormality of the breast",
"neuroendocrine tumor",
"hypoxemia",
"nephropathy",
"overnutrition",
"squamous cell cancer",
"systemic inflammatory response syndrome",
"brugada syndrome",
"toothache",
"antiphospholipid syndrome",
"cerebral arteriovenous malformation",
"chagas cardiomyopathy",
"cervical artery dissection",
"frozen shoulder",
"gaucher disease",
"hand foot and mouth disease",
"hand-foot syndrome",
"impaired psychomotor skills",
"inborn error of immunity",
"infectious disorder of the nervous system",
"lumbar disc herniation",
"machado-joseph disease",
"metopic craniosynostosis",
"prion disease",
"lofgrens syndrome",
"childhood ear infection",
"ligament rupture",
"lymphopenia",
"oral mucositis",
"mycobacterium avium complex disease",
"sensory peripheral neuropathy",
"bowel dysfunction",
"retinal vasculitis",
"ocular sarcoidosis",
"growth delay",
"aseptic loosening",
"asymptomatic neurocognitive impairment",
"mild neurocognitive disorder",
"coronary artery calcification",
"coronary vasospasm",
"genetic chronic primary adrenal insufficiency",
"isolated scaphocephaly",
"increased blood pressure",
"cervical dysplasia",
"anti-gad65 autoimmune neurological syndromes",
"atopy",
"bladder tumor",
"drug-induced agranulocytosis",
"bilateral adrenal hyperplasia",
"hypoalbuminemia",
"isolated craniosynostosis",
"memory impairment",
"cognitive decline (age-related)",
"neurotic disorder",
"stevens-johnson syndrome",
"tendinopathy",
"selective iga deficiency disease",
"antipsychotic drug related weight gain",
"chemotherapy-induced oral mucositis",
"viral and mycobacterial infections",
"ventricular dysfunction",
"toxic epidermal necrolysis",
"small artery occlusion",
"skin reaction",
"severe cutaneous adverse reaction",
"serum lipopolysaccharide activity",
"salivary gland lesion",
"reduced left ventricular ejection fraction",
"peripheral arterial disease",
"ossification of the posterior longitudinal ligament of the spine",
"ocular hypertension",
"cancer pain",
"neuropathic pain",
"autoimmune disease",
"chemotherapy-induced hypertension",
"cytomegalovirus infection",
"delayed encephalopathy after acute carbon monoxide poisoning",
"digestive system infectious disorder",
"drug-induced liver injury",
"familial clubfoot with or without associated lower limb anomalies",
"hepatitis virus-related hepatocellular cancer",
"intracranial thrombosis",
"limb dystonia",
"non-obstructive coronary artery disease",
"mucocutaneous lymph node syndrome",
"sudden cardiac arrest",
"graves ophthalmopathy",
"severe malarial anemia",
"prediabetes syndrome",
"neonatal abstinence syndrome",
"drug hypersensitivity syndrome",
"metabolic syndrome",
"pneumococcal bacteremia",
"mycobacterium infection",
"candidemia",
"lung disease associated with cystic fibrosis",
"neonatal systemic lupus erythematosus",
"multiple system atrophy",
"thiopurine immunosuppressant-induced pancreatitis",
"rash",
"petechiae",
"telangiectasia of the skin",
"human papilloma virus infection",
"chronic human papillomavirus infection",
"cystic fibrosis-related diabetes",
"sarcoma",
"lipedema",
"loss of ambulation",
"lymphedema",
"exercise induced anaphylaxis",
"somatic sensory dysfunction", # map to pain as relevant paper refers to:
# sensory symptoms (arthritic-like (aching) pain, burning or tingling in feet or hands, decreased ability to feel)
"internalizing disorder",
"decreased fine motor function",
"modic type vertebral endplate changes",
"cerebral microbleeds",
"cafe au lait spots",
"strep throat",
"bacterial meningitis",
"malaria",
"acute hepatitis a infection",
"chlamydophila infectious disease",
"cold sores",
"respiratory syncytial virus infection",
"fever",
"hemorrhagic fever with renal syndrome",
"non-typhoidal salmonella bacteremia",
"dengue",
"sneeze",
"encephalopathy acute infection-induce"
)
icd10_code = c("K70.3",
"K85",
"I25.5",
"M08.2",
"M08.9",
"M08.4",
"M86.3",
"M67.8",
"N39.4",
"R14",
"F00.0, G30.0",
"F00.1, G30.1",
"M10.3",
"O21, O21.9",
"G47.1",
"K86.1",
"H01.1",
"G61.0",
"J84.1",
"M35.2",
"M12.1",
"I27.8",
"I27.9",
"I27.9",
"R91",
"I26.9",
"G36.0",
"A31.1",
"M30.1",
"D89.8",
"M31.4",
"R32",
"F12.2",
"Q36, Q36.0, Q36.9, Q35, Q35.1, Q35.3, Q35.5, Q35.7, Q35.9",
"L30.9",
"F19.2",
"F14.1",
"C14.0",
"G93.2",
"T70.2",
"T70.2",
"O26.6",
"S06.9",
"S06.9",
"D73.3, K35, K36, K37, K57, K61, K63.0, K65, K75.0, K81, K83.0",
"N25.8",
"K31.8",
"C74.9",
"O90.3",
"C48.0",
"P24",
"B02.2",
"F30.9",
"H10.1",
"E87.1",
"E88.0",
"E06.3",
"E06.3",
"G60.0",
"G12.2",
"H18.5",
"G71.0",
"E78.6",
"K31",
"E74.9",
"L60",
"G72.3",
"F25",
"H33.0",
"G25.8",
"O42",
"E80.2",
"C48.2",
"F15.1, F15.2",
"I49.5",
"F19.1",
"R94.3",
"J35",
"I33.0",
"Q44.2",
"P27.1",
"H02.1",
"E27.1",
"Q34.8",
"K52.8",
"K57.3",
"Q67.4",
"Q53",
"M72.2",
"M72.2",
"G31.8",
"G24.1",
"G93.8",
"E29",
"F63",
"F50.8, F50.9",
"C96.9",
"T79",
"R74",
"R40.0, R40.1",
"I12",
"T84",
"H35",
"J84.0",
"O41.1",
"F42.8",
"Q60.0",
"R25.2",
"K12.0",
"K50.0",
"K52.8",
"K52.8",
"G25.8",
"E88",
"L43",
"N45",
"N45",
"H02.1",
"H02.0, H02.1",
"G24",
"D47.0, D47.1, D47.2, D47.3, D47.7, D47.9",
"M48.1",
"N72",
"K20",
"N04.1",
"E83.5",
"E78.1",
"E83.5",
"J84.8",
"B27",
"P77",
"F43",
"H91.0",
"B07",
"I89.0",
"G31.1",
"H21.2",
"I51.8",
"D41",
"G91.2",
"A85",
"E11.6",
"E10.6",
"R45.4",
"R45.4",
"R45.1",
"Q61",
"M77.9",
"M67.8",
"L70.8",
"R14",
"I66.9",
"T82.8",
"I20.8",
"I24.9",
"I35.0",
"I35.8",
"I05.8",
"I70.0",
"I65.2",
"F33",
"J41, J43, J44", #maybe more chronic lung diseases to include
"K92.1",
"K75.8",
"H04.1",
"P36",
"D61.8",
"R57.2",
"G12.2",
"D68.5",
"Q35, Q38.8",
"D47.0",
"F52",
"K72",
"T14.0",
"E78",
"J81, R09.0",
"J80",
"J45.9",
"Q44.7",
"S93.4",
"I77.8",
"I74",
"I65.2",
"C80",
"E10.4",
"E11.4",
"M15",
"F53.0",
"E78.4",
"R06.0",
"R31",
"E29",
"M62.8",
"E03.9",
"Q68.5",
"J80",
"C71.6",
"M62.5",
"I24.0",
"Q82.2",
"I80",
"R82.4",
"H46",
"R17",
"I61",
"I25.1",
"K11.7",
"E87.1",
"H21.2",
"K43.0, K43.1, K43.2",
"G72.4",
"Q64.2",
"I77.3",
"P35.4",
"E78.6",
"T39.3",
"I67.8",
"C71",
"G24",
"B25.9",
"A08.3",
"P78, P78.3",
"A31.0",
"R74",
"E88.9",
"M62.9",
"B37.1, B38, B44.0, B59, J17.2",
"H30.9",
"R96",
"D61",
"H01.1",
"I87",
"R29.8",
"R64, R62.8",
"E83.1",
"M21.7",
"E88.8",
"K12.1",
"G93.2, G93.5, G93.6",
"N62, N64.3, O92.6, Q83, Q83.0, Q83.1, Q83.2, Q83.3, Q83.8, Q83.9",
"D35.9",
"R09.0, T71",
"N05, N05.0, N05.1, N05.6, N05.7, N05.9, N06.0, N06.1, N06.6, N06.7, N07.0, N07.1, N07.6, N07.7, N08, N14, N14.0, N14.1, N14.2, N14.3, N14.4, N15.0, N15.8, N16.1, N16.2, N16.3, N16.4, N16.5",
"E67, E67.1, E67.2, E67.3",
paste0("C44.", 0:9, collapse = ", "),
"R65",
"I49.8",
"K08.8",
"D68.6",
"Q82.2",
"B57.0, B57.2",
"I67.0",
"M75.0",
"E75.2",
"B08.4",
"G62.0, L27.1",
"F82",
"D80",
"A88, A89",
"M51",
"G11",
"Q75.0",
"A81",
"D86.0",
"H66.9",
"T14.3",
"D72.8",
"K12.3",
"A31.0",
"G60",
"K59",
"H35.0",
"D86.8",
"E23.0",
"T84",
"F06.7",
"F06.7",
"I25.1, I25.8",
"I20.1",
"E27.1",
"Q75.0",
"R03.0",
"N87",
"G04.8, G25.8, G32.8",
"T78.4",
"D41.4",
"D70",
"E26.0",
"E88.0",
"Q75.0",
"R41.1, R41.2, R41.3",
"R41.8",
"F48",
"L51.1",
"M76, M76.6, M76.8",
"D80.2",
"E66.1, T43.5",
"K12.0",
"A31.9, B34.9",
"I97.1",
"L51.2",
"I63",
"L27.0, L27.1",
"L27.0, L27.1",
"R79.8",
"K11.8",
"I50.1",
"I73.9",
"M48.4",
"H40.0",
"R52",
"R52",
"D89.9",
"I15.9",
"B25.9",
"G92",
"A89",
"K71.9",
"Q66.8",
"C22",
"I67.6",
"G24.8",
"I25.8, I25.9",
"M30.3",
"I46",
"H58.8",
"B54, D63.8",
"R73.0",
"P96.1",
"T88.7",
"E88.8",
"A49.9",
"A31",
"B37.7",
"E84.0",
"P00.8",
"G23.2, G23.3",
"K85.3",
"R21",
"R23.3",
"I78.8, I78.9",
"B97.7, R87.4",
"R86.4", # because study on chronic human papillomavirus infection was in male cohort only
"E84.8, E13.9" ,
"C49.9",
"R60.9",
"R26.2, R26.3",
"I89.0",
"T78.2",
"R52",
"F99",
"R27.8",
"M51.3",
"I67.9, R90.8",
"L81.3",
"J02.0",
"G00",
"B54",
"B15",
"A55-A56.8, K67.0, N74.4",
"B00.1",
"J20.5. J21.0, B97.4",
"R50",
"A98.5",
"A49",
"A97",
"R06.7",
"G93.4"
)
to_add = data.frame(collected_all_disease_terms,
icd10_code)
to_add = to_add |>
rename(mapped_trait = collected_all_disease_terms)
# Expand multiple ICD codes into rows
to_add_expanded <- to_add |>
mutate(icd10_code = str_split(icd10_code, ",\\s*")) |>
tidyr::unnest(icd10_code)
icd_desc_map =
phecodes |>
select(icd10_code = ICD10,
icd_description = ICD_DESCRIPTION
)
icd_desc_map =
icd_desc_map |>
distinct()
# if more than one ICD10 code per phecode, collapse into a single row
icd_desc_map =
icd_desc_map |>
group_by(icd10_code) |>
summarise(icd_description =
str_flatten(unique(icd_description),
collapse = "; ",
na.rm = T))
# Join with phecodes to get descriptions
to_add_expanded <- to_add_expanded |>
left_join(icd_desc_map |> select(icd10_code,
icd_description),
by = c("icd10_code"))
# if ICD10 code O26.6, then icd_description
# Liver disorders in pregnancy, childbirth and the puerperium
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "O26.6",
"Liver disorders in pregnancy, childbirth and the puerperium",
icd_description))
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "F43",
"Reaction to severe stress, and adjustment disorders",
icd_description))
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "F33",
"Recurrent depressive disorder",
icd_description))
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "R57.2",
"Septic shock",
icd_description))
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "D68.5",
"Primary thrombophilia",
icd_description))
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "E78",
"Disorders of lipoprotein metabolism and other lipidaemias",
icd_description))
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "S93.4",
"Sprain and strain of ankle",
icd_description))
# F53.0 Mild mental and behavioural disorders associated with the puerperium, not elsewhere classified
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "53.0",
"Mild mental and behavioural disorders associated with the puerperium, not elsewhere classified",
icd_description))
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "I87",
"Other disorders of veins",
icd_description))
# R65 Systemic Inflammatory Response Syndrome [SIRS]
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "R65",
"Systemic Inflammatory Response Syndrome [SIRS]",
icd_description))
# D68.6 - Other thrombophilia
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "D68.6",
"Other thrombophilia",
icd_description))
# R52 - Pain, not elsewhere classified
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "R52",
"Pain, not elsewhere classified",
icd_description))
# H58.8 Other specified disorders of eye and adnexa in diseases classified elsewhere
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "H58.8",
"Other specified disorders of eye and adnexa in diseases classified elsewhere",
icd_description))
# T14.3 - Dislocation, sprain and strain of unspecified body region
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "T14.3",
"Dislocation, sprain and strain of unspecified body region",
icd_description))
# M51 - Other intervertebral disc disorders
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "M51",
"Other intervertebral disc disorders",
icd_description))
# P00.8 - Fetus and newborn affected by other maternal conditions
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "P00.8",
"Fetus and newborn affected by other maternal conditions",
icd_description))
# F48 - Other neurotic disorders
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "F48",
"Other neurotic disorders",
icd_description))
# K12.3 - Oral mucositis (ulcerative)
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "K12.3",
"Oral mucositis (ulcerative)",
icd_description))
# F53.0 - Mild mental and behavioural disorders associated with the puerperium, not elsewhere classified
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "F53.0",
"Mild mental and behavioural disorders associated with the puerperium, not elsewhere classified",
icd_description))
# R96 - Other sudden death, cause unknown
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "R96",
"Other sudden death, cause unknown",
icd_description))
# K85.3 - Drug-induced acute pancreatitis
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "K85.3",
"Drug-induced acute pancreatitis",
icd_description))
# P35.4 - Congenital Zika virus disease
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "P35.4",
"Congenital Zika virus disease",
icd_description))
# A31 - Infection due to other mycobacteria
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "A31",
"Infection due to other mycobacteria",
icd_description))
# M76 - Enthesopathies of lower limb, excluding foot
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "M76",
"Enthesopathies of lower limb, excluding foot",
icd_description))
# K43.2 - Incisional hernia without obstruction or gangrene
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "K43.2",
"Incisional hernia without obstruction or gangrene",
icd_description))
# A88 - Other viral infections of central nervous system, not elsewhere classified
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "A88",
"Other viral infections of central nervous system, not elsewhere classified",
icd_description))
# R26.3 - Immobility
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "R26.3",
"Immobility",
icd_description))
# G23.3 - Multiple system atrophy, cerebellar type [MSA-C]
to_add_expanded <- to_add_expanded |>
mutate(icd_description = ifelse(icd10_code == "G23.3",
"Multiple system atrophy, cerebellar type [MSA-C]",
icd_description))
# Collapse back into one row per disease
to_add_with_desc <- to_add_expanded |>
group_by(mapped_trait) |>
summarise(
icd10_code = paste(icd10_code, collapse = ", "),
icd10_desc = paste(icd_description, collapse = "; "),
.groups = "drop"
)
to_add_with_desc =
to_add_with_desc |>
arrange(mapped_trait)
to_add_with_desc |>
writexl::write_xlsx(here::here("data/icd/manual_disease_icd10_mappings.xlsx"))
sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS 15.6.1
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
time zone: America/Los_Angeles
tzcode source: internal
attached base packages:
[1] stats graphics grDevices datasets utils methods base
other attached packages:
[1] stringr_1.5.1 dplyr_1.1.4 data.table_1.17.8 workflowr_1.7.1
loaded via a namespace (and not attached):
[1] jsonlite_2.0.0 compiler_4.3.1 renv_1.0.3 promises_1.3.3
[5] tidyselect_1.2.1 Rcpp_1.1.0 git2r_0.36.2 tidyr_1.3.1
[9] callr_3.7.6 later_1.4.2 jquerylib_0.1.4 yaml_2.3.10
[13] fastmap_1.2.0 here_1.0.1 R6_2.6.1 generics_0.1.4
[17] knitr_1.50 tibble_3.3.0 rprojroot_2.1.0 bslib_0.9.0
[21] pillar_1.11.0 rlang_1.1.6 cachem_1.1.0 stringi_1.8.7
[25] httpuv_1.6.16 xfun_0.52 getPass_0.2-4 fs_1.6.6
[29] sass_0.4.10 cli_3.6.5 withr_3.0.2 magrittr_2.0.3
[33] ps_1.9.1 digest_0.6.37 processx_3.8.6 rstudioapi_0.17.1
[37] lifecycle_1.0.4 vctrs_0.6.5 writexl_1.5.4 evaluate_1.0.4
[41] glue_1.8.0 whisker_0.4.1 purrr_1.1.0 rmarkdown_2.29
[45] httr_1.4.7 tools_4.3.1 pkgconfig_2.0.3 htmltools_0.5.8.1