DOI: 10.5281/zenodo.10958731
title: Prediction of individual disease progression including parameter uncertainty in rare neurodegenerative diseases: the example of Autosomal-Recessive Spastic Ataxia Charlevoix Saguenay (ARSACS)  - code and data sets

description: This repository contains the scripts for the paper in revision to the AAPS J: Prediction of individual disease progression including parameter uncertainty in rare neurodegenerative diseases: the example of Autosomal-Recessive Spastic Ataxia Charlevoix Saguenay (ARSACS) 

Authors: Niels Hendrickx, MSc, France Mentré, MD, PhD, Andreas Traschütz, MD, PhD, Cynthia Gagnon, PhD, Rebecca Schüle, MD, ARCA Study Group, EVIDENCE-RND consortium, Matthis Synofzik, MD, Emmanuelle Comets, PhD

A simulated dataset (simulated_arsacs.csv) has been included in the repository to make the code executable as a standalone. Four main scripts have been provided in addition with the present Readme describing the files. The repository also includes 3 R objects and 2 folders which will be overwritten when the scripts are run, and are included as examples of the expected outputs. The main scripts are:

- Script_imputation_selection.R: runs the covariate selection method. It uses a simulated dataset provided in the depot. The multiple imputation model is hardcoded as an input to the mice package to generate 10 imputed datasets, saved in current_directory/imputed_data_sets/df_arsacs_mi_i.csv. The script then runs the covariate selection method. The script prints out the list of selected covariates and returns a saemixObject containing the fit of the selected covariate model. After the script executes, a list will be saved with the name of the selected covariates in the current directory (an example is included under the name "cov_matrix_model.RData" in the repository), the output of the selection, containing the whole history of runs will be saved under "final_covariate_model.RData", the list of selected covariate names will be saved under "list_covariates.RData".

- source_mi.R: contains the functions used by Script_imputation_selection.R

- script_bootstrap_indfit.R: This script loads "cov_matrix_model.RData" containing the matrix of covariate effects (used by saemix) and "list_covariates.RData", the list of covariates included, fits the model on the imputed data sets and computes its bootstrap distribution for each imputed data set (in the script, using only 20 samples for computation time, saved in current_directory/bootstrap/boot.arsacs.case.mi.i). It then computes the mean parameter and relative standard error of each parameter. It then computes the conditional distribution of each patient in each bootstrap samples and returns a data frame of individual predictions. The script will then plot 4 indivudal predictions. 

- source_bootstrap.R: contains the functions used by script_bootstrap_indfit.R

Both scripts need the saemix package to run, which we haven’t included in the repository as it is freely available on the CRAN (https://cran.r-project.org/web/packages/saemix/index.html). Additional libraries we make use of in the code (MICE, tidyverse, ggplot2) also need to be installed prior to execution. The R code provided can be further customised to be adapted to different scenarios.

For the code to run, it is preferable to unzip the whole folder and set the working directory to the source file location as the script uses the "bootstrap" and "imputed_data_sets" sub-folders

To execute this code, assuming the required libraries are available in the local R installation, please open an R session and run:source("Script_imputation_selection.R") # for the covariate selection method (runtime: 3h on a  i7-8565U laptop)source("script_bootstrap_indfit.R") # to obtain individual trajectories (runtime: 1h on a  i7-8565U laptop)