/vulnerability_2021

Repository containing the code and methods for Bosch et al. 2021

Primary LanguageR

Vulnerability 2021

Repository containing the code and methods for Bosch & DeJesus et al. 2021

Below is a short legend describing the main files, followed by example running the code:

vulnerability_modeling_tools.R

R code with functions useful for running the vulnerability analysis.

vulnerability_plotting_tools.R

R code with functions useful for plotting vulnerability results

gene_vul_analysis_parallel.R

R code for running vulnerability analysis in paralell.

single_guide_cov_betalogistic.stan

Stan code for the vulnerability model.

gene_vul_plots_parallel.R

R code for creating plots of vulnerability results in parallel.

Example

Analysis

To run the actual analysis with example parameters simply run:

Rscript gene_vul_analysis_parellel.R

Alternatively, users can provide three parameters:

  • desired_strain (label to describe strain being analyzed, helpful to distinguish results)
  • label (general label to distinguish results)
  • data_path (path to the CSV formatted file with passaging data)

Rscript gene_vul_analysis_parellel.R H37Rv test example_H37Rv_data.txt

Plotting

Similarly, users can create plots of the results by running the following command:

Rscript gene_vul_plots_parallel.R

Alternatively users can provide four parameters:

  • desired_strain (label to describe strain being analyzed, helpful to distinguish results)
  • label (general label to distinguish results)
  • data_path (path to the CSV formatted file with passaging data)
  • results path (path to the directory containing the resuls from the analysis.)

Rscript gene_vul_plots_parallel.R H37Rv test example_H37Rv_data.txt data/H37Rv/test/