
Generation of mutation posets, genotype lattices and resistance factors
---------------------------------------------------------------------------

Prerequisites:
--------------
- Install the latest ICBN package from http://www.silva.bsse.ethz.ch/cbg/software/icbn
- Install the latest CT-CBN package from http://www.silva.bsse.ethz.ch/cbg/software/ct-cbn


Data:
---------
Two data files zdv.Rdata and idv.Rdata contain in vitro genotype-phenotype datasets for zidovudine and indinavir. Both datasets were extracted from Stanford genotype-phenotype datasets at:
http://hivdb.stanford.edu/cgi-bin/GenoPhenoDS.cgi


Usage: 
---------
Use the function "generate_input_files_for_ode_model" to generate all the necessary input files for the ODE model. See the R script "hivfit_statistical_part.R" for the application of this function to two datasets for zidovudine and indinavir.

Estimation of fitness characteristics and monotherapy simulations
---------------------------------------------------------------------------

Prerequisites:
--------------
MATLAB R2010b or later with the Optimization toolbox

---------------------------------------------------------------------------
Notes for usage of MATLAB codes for estimation of fitness characteristics of 
HIV mutant genotypes:
---------------------------------------------------------------------------

ZDV_Estimation.m

This code estimates fitness costs and selective advantages of zidovudine-resistant
mutant genotypes. The code reads in the average statistical waiting times estimated
by the CT-CBN model and resistance factors estimated by the ICBN model (see files 
cbn_models.R and hivfit_statistical_part.R). The code is written in a way to automatically 
generate a mutation matrix to facilitate generalization.The estimation is performed by 
a simplex search with a function fminsearchbnd written in MATLAB. Further refinement is 
achieved by MATLAB's optimizing function simulannealbnd that implements constrained simulated
annealing. Repeated estimations (at least 500) are performed to infer conserved char-
acteristics of fitness.

ZDV_Simulation.m

This function simulates viral dynamics during zidovudine monotherapy. It uses a (best) fitness
cost set estimated in the above function, resistance factors estimated by the ICBN model and
the mutation posets estimated by the CT-CBN model.

The code is written in a way to automatically generate a mutation matrix from the CT-CBN model 
to facilitate generalization.

IDV_Simulation.m

This function simulates viral dynamics during zidovudine monotherapy. It uses a (best) fitness
cost set estimated in the above function, resistance factors estimated by the ICBN model and
the mutation posets estimated by the CT-CBN model.

The code is written in a way that explicitly inputs the mutation reactions to clarify the mechanics
of the code.

