C. W. H. Lo, D. Handley, O. Pain, M. Kamp, A. C. Gillett, M. H. Iveson, C. Fabbri, K. G. Young, AMBER Research Team, C. M. Lewis
Motivation Linkage between population-wide biobanks and electronic health records (EHRs) opens new opportunities to study the genetic and epidemiological underpinnings of treatment outcomes. However, data extraction is often complex, and the lack of open, reproducible phenotyping algorithms makes it difficult to scale analyses and compare findings across studies. Implementation T-Rx is an open-source R package consisting of three modules: (1) Extraction and Imputation Module; (2) Exposure Ascertainment Module; and (3) Phenotyping Module. General features T-Rx allows the extraction and imputation of prescription details, such as product strength and prescribed quantity in UK-based EHR databases, including UK Biobank and CPRD. The Exposure Ascertainment Module converts discrete prescribing events into longitudinal exposure periods in one-line R commands. The Phenotyping Module inputs prescriptions and returns phenotype dataframes for downstream analyses. Availability T-Rx is available as a Github Repository at [https://github.com/chrislowh/T-Rx]. Documentation is available at: [https://chrislowh.github.io/T-Rx/].