Code for deriving algorithmic phenotypes from the second Mental Health Questionnaire in UK Biobank, conducted in 2023. This code is contained within Davis et al, In Prep.
- R (tested with version 4.3.0)
- data.table (tested with version 1.15.4)
- tidyverse (tested with version 2.0.0)
- dplyr (tested with version 1.1.4)
- optparse (tested with version 1.7.5)
With R loaded in the system path:
Rscript Overarching.R
Usage: Overarching.R [options]
Options:
-h, --help
Show this help message and exit
-i INPUT-DATA-FILE-PATH, --input-data-file-path=INPUT-DATA-FILE-PATH
File path to a file to read as the data to process.
-o OUTPUT-DATA-FILE-PATH, --output-data-file-path=OUTPUT-DATA-FILE-PATH
File path to a file to write as the processed data.
-v VARIABLES, --variables=VARIABLES
Comma separated string of variable names to export from the processed data.
If Overarching.R is run without specifying variables, it will output all derived phenotypes for the second mental health questionnaire, as described in Davis et al.
Input data can be in RDS format, or as a flat text file (.tsv), and must contain all fields necessary to generate the variables requested - a full list of input and possible output variables is available in Overarching.R.
Individual module scripts are available as .R and as .Rmd in the scripts folder.
Tables for Davis et al were generated using code described in scripts/Tables_For_Paper.Rmd
- Johan Zvrskovec - KCL
- Megan Skelton - KCL
- Danyang Li - KCL
- Abigail ter Kuile - UCL
- Ruija Wang - KCL
- Jared Maina - KCL
- Helena Davies - Aarhus
- Zhaoying Yu - KCL
- Christopher Huebel - Aarhus
- Mark James Adams - Edinburgh
- Jonathan Coleman - KCL
This project is licensed under the MIT License - see the LICENSE.md file for details
This research is funded by the National Institute for Health and Care Research (NIHR) Maudsley Biomedical Research Centre (BRC). The views expressed are those of the authors and not necessarily those of the NIHR or the Department of Health and Social Care. Primary development and testing of code was undertaken on the King's College London Computational Research, Engineering and Technology Environment (CREATE).