Skip to content

Commit

Permalink
Restricted new mutation probability to not exceed 100%.
Browse files Browse the repository at this point in the history
  • Loading branch information
pineapple-cat committed Jan 13, 2025
1 parent 698a565 commit 78c40b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hivpy/resistance_mutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def cd4_change(self, pop: Population, sub_pop):
"""
Update CD4 count for HIV+ individuals.
"""
# get viral load outcomes
# get cd4 outcomes
cd4, cd4_delta = pop.col_apply([col.AGE, col.SEX, col.NUM_ACTIVE_DRUGS, col.CONT_ON_ART, col.ART_ADHERENCE,
pop.get_correct_column(col.ART_ADHERENCE, dt=1), col.ON_NEV, col.ON_EFA,
col.ON_DOL, col.ON_LPR, col.ON_TAZ, col.ON_DAR, pop.get_correct_column(col.CD4, dt=1),
Expand Down Expand Up @@ -355,7 +355,7 @@ def calc_prob_new_mutation(self, active_drugs, cont_on_art, adherence, adherence
x = self.get_matrix_val(self.new_mutation_matrix, active_drugs, cont_on_art, adherence,
adherence_tm1, on_nev, on_efa)
# calculate new mutation probability
prob_new_mutation = x * (viral_load + viral_load_tm1)/2
prob_new_mutation = min(x * (viral_load + viral_load_tm1)/2, 1)

return prob_new_mutation

Expand Down

0 comments on commit 78c40b2

Please sign in to comment.