A skeleton package, to be used as a starting point when implementing patient-level prediction studies.
Vignette: Using the package skeleton for patient-level prediction studies
For information on how to generate shiny apps using the R skeleton package see: Creating shiny app for patient-level prediction studies. To combine multiple skeleton package results into a single shiny app see populate multiple shiny app R code code
For information on adding custom covariates based on ATLAS cohorts see: Adding custom covariates using ATLAS cohorts.
source('./extras/packageDeps.R')
library(SkeletonPredictionStudy) # USER INPUTS #======================= # The folder where the study intermediate and result files will be written: outputFolder
The ‘createCohorts’ option will create the target and outcome cohorts into cohortDatabaseSchema.cohortTable if set to T. The ‘runAnalyses’ option will create/extract the data for each prediction problem setting (each Analysis), develop a prediction model, internally validate it if set to T. The results of each Analysis are saved in the ‘outputFolder’ directory under the subdirectories ‘Analysis_1’ to ‘Analysis_N’, where N is the total analyses specified. After running execute with ‘runAnalyses set to T, a ’Validation’ subdirectory will be created in the ‘outputFolder’ directory where you can add the external validation results to make them viewable in the shiny app or journal document that can be automatically generated.
execute(connectionDetails = connectionDetails, cdmDatabaseSchema = cdmDatabaseSchema, cdmDatabaseName = cdmDatabaseName, cohortDatabaseSchema = cohortDatabaseSchema, cohortTable = cohortTable, outputFolder = outputFolder, createValidationPackage = T)
execute(connectionDetails = connectionDetails, cdmDatabaseSchema = cdmDatabaseSchema, cdmDatabaseName = cdmDatabaseName, cohortDatabaseSchema = cohortDatabaseSchema, cohortTable = cohortTable, outputFolder = outputFolder, createValidationPackage = T, analysesToValidate = c(1,3))
This will create a new subdirectory in ‘outputFolder’ that has the name
execute(connectionDetails = connectionDetails, cdmDatabaseSchema = cdmDatabaseSchema, cdmDatabaseName = cdmDatabaseName, cohortDatabaseSchema = cohortDatabaseSchema, cohortTable = cohortTable, outputFolder = outputFolder, createShiny = T, minCellCount= 5) PatientLevelPrediction::viewMultiplePlp(outputFolder)
If you saved the validation results into the validation folder in the directory you called ‘outputFolder’ in the structure: ‘
execute(connectionDetails = connectionDetails, cdmDatabaseSchema = cdmDatabaseSchema, cdmDatabaseName = cdmDatabaseName, cohortDatabaseSchema = cohortDatabaseSchema, cohortTable = cohortTable, outputFolder = outputFolder, createJournalDocument = F, analysisIdDocument = 1 minCellCount= 5)