This is the public repository for the paper titled, "Serum antibodies are unreliable correlates of protection against norovirus infection and disease," by Miller et al.
This study examines the relationships between antibody titers and clinical outcomes in two human challenge studies (data are located here and here).
-
The general setup of this repository is as follows:
-
The
assetsfolder contains the reference files accessed in document rendering (i.e. main text and supplement) -
The
codefolder contains all code used to run analyses and generate results. -
The
datafolder contains the final processed data used in model fitting. -
The
productsfolder contains all files for submission. -
The
resultsfolder contains all model output, results, figures, and tables generated by any of the code scripts.
-
-
These analyses are set up as an R project. To reproduce this analysis, you will need the
RandRStudiosoftware, as well as the packages cited and listed in the Session Info in the Supplement. The project usesrenvto help ensure reproducibility and contains all needed packages. -
To start, open the
.Rprojfile with RStudio. -
Run
renv::restore()to download all used packages and dependencies in the versions used in conducting this analysis. This will install thecmdstanrpackage along with all others. After this installation, follow the steps listed on this post to complete installation and prepare for model fitting: Getting started with CmdStanR -
The project folder and sub-folders contain README files that provide further information. Each R script is also fully documented to allow easy reproducibility.
-
To completely replicate our main analysis and recreate figures and tables shown in the main text and supplement, run the code scripts in the following order:
1) `code/01-mod-fit-main-analysis.R`
2) `code/02-fig-gen-main-analysis.R`
3) `code/03-tbl-gen-main-analysis.R`
-
Code scripts starting with 04-06 and 07-09 run the associated code for sensitivity analyses using different limit of detection definitions and not accounting for censoring, respectively. Script
10-tbl-gen-combined-results.Ruses results aggregated in scripts 03, 06, and 09 to create one overall table organized by model version. -
The
model-functions.R(ormodel-functions-no-censoring.Rfor that tsensitivity analysys) script will be sourced at the beginning of the model fitting scripts, so it does not need to run explicitly. However, it contains all the code used to fit the models and extract all needed results for plotting and table generation, so any alterations would need to take place in that script. Stan models will be compiled at the beginning of every script where needed, and can be found in thecode/stan-codefolder. -
As many of the object and file names are the same across different versions of the analysis (but separated by subfolders), I recommend clearing your environment in between running different versions of the analysis.
-
General LoD figure and table generation is located in
code/11-lod-figures.R.
All of the code we wrote is distributed under the Affero GNU GPL v3.0. Any code that was not written by us has been attributed and is released under the conditions of its own license. Any text and images we created are licensed under the Creative Commons 4.0 BY-NC-SA international license.