Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create resistance mutations module #219

Open
wants to merge 37 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e6e7b54
Started resistance mutations module and moved some variable inits fro…
pineapple-cat Dec 6, 2024
655e74d
Updated viral load column to store past timestep and changed multi-ti…
pineapple-cat Dec 6, 2024
3d76cd6
Added new mutation probability multiplier matrix and some new revelan…
pineapple-cat Dec 17, 2024
6aadebe
Merge branch 'development' into resistance-mutations
pineapple-cat Dec 17, 2024
e9eb9b1
Style unification.
pineapple-cat Dec 17, 2024
36eb9d4
Fixing tests via further style update.
pineapple-cat Dec 17, 2024
c695e3d
Added new mutation probability calculation.
pineapple-cat Dec 20, 2024
fbfb2da
Added CD4 delta multiplier matrix.
pineapple-cat Jan 9, 2025
d4afed0
Updated new mutation matrix format to fit with CD4 delta matrix.
pineapple-cat Jan 9, 2025
b45b3f4
Added matrix value retrieval function.
pineapple-cat Jan 9, 2025
53a56a9
Added more ART drug columns.
pineapple-cat Jan 9, 2025
b4ac9b8
Added CD4 delta calculation.
pineapple-cat Jan 9, 2025
be0ce52
Added base viral load matrix.
pineapple-cat Jan 10, 2025
b1d8d0c
Updated matrix lookup.
pineapple-cat Jan 10, 2025
3cdb220
Added viral load and viral load delta calculation.
pineapple-cat Jan 10, 2025
a29ff28
Reorganising file.
pineapple-cat Jan 10, 2025
3791957
Added more HIV columns for viral load and CD4 changes.
pineapple-cat Jan 13, 2025
6259831
Added viral load update function.
pineapple-cat Jan 13, 2025
833643e
Updated viral load range.
pineapple-cat Jan 13, 2025
698a565
Added CD4 update function.
pineapple-cat Jan 13, 2025
78c40b2
Restricted new mutation probability to not exceed 100%.
pineapple-cat Jan 13, 2025
099939d
Added new mutation risk multiplier.
pineapple-cat Jan 16, 2025
385ea36
Simplified conditions in CD4 calculation for finding people on ARVs.
pineapple-cat Jan 16, 2025
ca78dd6
Removed unused viral load delta column.
pineapple-cat Jan 16, 2025
ddc29ff
Added column for continuous time on ARVs.
pineapple-cat Jan 16, 2025
7fd1393
Updated viral load matrix values.
pineapple-cat Jan 17, 2025
46e6ee5
Added all antiretroviral drug columns.
pineapple-cat Jan 17, 2025
37fce51
Updated resistance mutation columns with more unified names.
pineapple-cat Jan 17, 2025
bf3f5fe
Moved ART columns to one place and rehomed resistance mutation count.
pineapple-cat Jan 17, 2025
71a442f
Added resistance init to population and update to evolution.
pineapple-cat Jan 20, 2025
fefa072
Fixing variables with previous timestep columns.
pineapple-cat Jan 20, 2025
1c9bd1f
Debugging fixes.
pineapple-cat Jan 20, 2025
001cf2a
Added matrix retrieval test.
pineapple-cat Jan 20, 2025
bf4f983
Added tests for viral load and new mutation probability calculations.
pineapple-cat Jan 20, 2025
9a821b9
Added CD4 calculation test.
pineapple-cat Jan 20, 2025
562adcc
Style fixes.
pineapple-cat Jan 20, 2025
7e1d6eb
Adjusted CD4 calculation ordering to make sense.
pineapple-cat Jan 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 77 additions & 57 deletions src/hivpy/column_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
NUM_HIV_CHILDREN = "num_HIV_children" # int: number of children infected with HIV a woman has
WANT_NO_CHILDREN = "want_no_children" # bool: True if a woman does not want any more children

ON_ART = "on_art" # bool: True if a person is currently on ART

SEX_WORKER = "sex_worker" # bool: True if person is a sex worker, o/w False
SW_AGE_GROUP = "sw_age_group" # int: categorises sex worker behaviour by age
DATE_STOP_SW = "date_stop_sex_work" # date: date at which a former sex worker (last) stopped sex work
Expand Down Expand Up @@ -82,26 +80,27 @@
VIRAL_LOAD_GROUP = "viral_load_group" # int: value 0-5 placing bounds on viral load for an HIV positive person. [(0, 2.7), (2.7, 3.7), (3.7, 4.7), (4.7, 5.7), > 5.7, primary infection]
UNDER_CARE = "under_care" # bool: True if under care after a positive HIV diagnosis
VIRAL_LOAD = "viral_load" # float: viral load for HIV+ person
MAX_VIRAL_LOAD = "max_viral_load" # float: maximum viral load for a given time step? (DUMMY)
VIRAL_SUPPRESSION = "viral suppression" # bool: True if person is virally suppressed
RESISTANCE_MUTATIONS = "resistance_mutations" # integer: total proportion of (people in?) resistance mutations
CD4 = "cd4" # None | float: CD4 count per cubic millimeter; set to None for people w/o HIV
CD4_DELTA = "cd4_delta" # float: change in CD4 count since the last time step
MAX_CD4 = "max_cd4" # float: maximum CD4 count to which a person can return when on ART
ART_NAIVE = "art_naive" # bool: True if person has never been on antiretroviral therapy
CD4_RECOVERY_ON_ART = "cd4_recovery_on_art" # float: individual propensity for immune recovery given viral suppression
X4_VIRUS = "x4_virus" # bool: True if X4 virus is present in person, False otherwise

WHO3_EVENT = "who3_event" # Bool: True if who3 disease occurs this timestep in HIV positive person
NON_TB_WHO3 = "non_tb_who3" # Bool: True if non-tb who3 disease occurs this timestep in HIV positive person
TB = "tb" # Bool: True if tb occurs this timestep in HIV positive person
TB_DIAGNOSED = "tb_diagnosed" # Bool: True if TB is diagnosed this timestep
WHO3_EVENT = "who3_event" # bool: True if who3 disease occurs this timestep in HIV positive person
NON_TB_WHO3 = "non_tb_who3" # bool: True if non-tb who3 disease occurs this timestep in HIV positive person
TB = "tb" # bool: True if tb occurs this timestep in HIV positive person
TB_DIAGNOSED = "tb_diagnosed" # bool: True if TB is diagnosed this timestep
TB_INFECTION_DATE = "tb_infection_date" # date: Date of start of most recent TB infection
TB_INITIAL_INFECTION = "tb_initial_infection" # Bool: True if TB infection began this timestep
C_MENINGITIS = "c_meningitis" # Bool: True if cryptococcal meningitis occurs this timestep
C_MENINGITIS_DIAGNOSED = "c_meningitis_diagnosed" # Bool: True if cryptococcal meningitis diagnosed this timestep
SBI = "serious_bacterial_infection" # Bool: True if serious bacterial infection this time step
SBI_DIAGNOSED = "sbi_diagnosed" # Bool: True if SBI diagnosed this time step
WHO4_OTHER = "who4_other" # Bool: True if other WHO4 disease occurs this timestep
WHO4_OTHER_DIAGNOSED = "who4_other_diagnosed" # Bool: True if other WHO4 disease diagnosed this timestep
ADC = "AIDS_defining_condition" # Bool: presence of AIDS defining condition (any WHO4)
TB_INITIAL_INFECTION = "tb_initial_infection" # bool: True if TB infection began this timestep
C_MENINGITIS = "c_meningitis" # bool: True if cryptococcal meningitis occurs this timestep
C_MENINGITIS_DIAGNOSED = "c_meningitis_diagnosed" # bool: True if cryptococcal meningitis diagnosed this timestep
SBI = "serious_bacterial_infection" # bool: True if serious bacterial infection this time step
SBI_DIAGNOSED = "sbi_diagnosed" # bool: True if SBI diagnosed this time step
WHO4_OTHER = "who4_other" # bool: True if other WHO4 disease occurs this timestep
WHO4_OTHER_DIAGNOSED = "who4_other_diagnosed" # bool: True if other WHO4 disease diagnosed this timestep
ADC = "AIDS_defining_condition" # bool: presence of AIDS defining condition (any WHO4)

R_PREP = "r_prep" # float: a semi-permanent random personal variable that determines whether someone is risk informed or suspects they are at risk enough to take PrEP
PREP_ORAL_PREF = "prep_oral_pref" # float: a value that determines and individual's preference for oral PrEP
Expand All @@ -112,29 +111,29 @@
PREP_CAB_RANK = "prep_cab_rank" # int: an individual's preference ranking for injectable Cabotegravir PrEP
PREP_LEN_RANK = "prep_len_rank" # int: an individual's preference ranking for injectable Lenacapavir PrEP
PREP_VR_RANK = "prep_vr_rank" # int: an individual's preference ranking for vaginal ring PrEP
PREP_ORAL_WILLING = "prep_oral_willing" # Bool: True if an individual is willing to use oral PrEP
PREP_CAB_WILLING = "prep_cab_willing" # Bool: True if an individual is willing to use injectable Cabotegravir PrEP
PREP_LEN_WILLING = "prep_len_willing" # Bool: True if an individual is willing to use injectable Lenacapavir PrEP
PREP_VR_WILLING = "prep_vr_willing" # Bool: True if an individual is willing to use vaginal ring PrEP
PREP_ANY_WILLING = "prep_any_willing" # Bool: True if an individual is willing to use at least one type of PrEP
FAVOURED_PREP_TYPE = "favoured_prep_type" # None | prep.PrEPType(enum): PrEP type with highest preference an individual is willing to take that is also currently available, o/w None
PREP_ELIGIBLE = "prep_eligible" # Bool: True if an individual is eligible for PrEP usage
PREP_ORAL_TESTED = "prep_oral_tested" # Bool: True if an individual has tested explicitly to start oral PrEP (DUMMY)
PREP_CAB_TESTED = "prep_cab_tested" # Bool: True if an individual has tested explicitly to start injectable Cab PrEP (DUMMY)
PREP_LEN_TESTED = "prep_len_tested" # Bool: True if an individual has tested explicitly to start injectable Len PrEP (DUMMY)
PREP_VR_TESTED = "prep_vr_tested" # Bool: True if an individual has tested explicitly to start vaginal ring PrEP (DUMMY)
PREP_TYPE = "prep_type" # None | prep.PrEPType(enum): Oral, Cabotegravir, Lenacapavir, or VaginalRing if PrEP is being used, o/w None
EVER_PREP = "ever_prep" # Bool: True if an individual has ever been on PrEP
PREP_ORAL_WILLING = "prep_oral_willing" # bool: True if an individual is willing to use oral PrEP
PREP_CAB_WILLING = "prep_cab_willing" # bool: True if an individual is willing to use injectable Cabotegravir PrEP
PREP_LEN_WILLING = "prep_len_willing" # bool: True if an individual is willing to use injectable Lenacapavir PrEP
PREP_VR_WILLING = "prep_vr_willing" # bool: True if an individual is willing to use vaginal ring PrEP
PREP_ANY_WILLING = "prep_any_willing" # bool: True if an individual is willing to use at least one type of PrEP
FAVOURED_PREP_TYPE = "favoured_prep_type" # prep.PrEPType(enum): PrEP type with highest preference an individual is willing to take that is also currently available, o/w NoPrEP
PREP_ELIGIBLE = "prep_eligible" # bool: True if an individual is eligible for PrEP usage
PREP_ORAL_TESTED = "prep_oral_tested" # bool: True if an individual has tested explicitly to start oral PrEP (DUMMY)
PREP_CAB_TESTED = "prep_cab_tested" # bool: True if an individual has tested explicitly to start injectable Cab PrEP (DUMMY)
PREP_LEN_TESTED = "prep_len_tested" # bool: True if an individual has tested explicitly to start injectable Len PrEP (DUMMY)
PREP_VR_TESTED = "prep_vr_tested" # bool: True if an individual has tested explicitly to start vaginal ring PrEP (DUMMY)
PREP_TYPE = "prep_type" # prep.PrEPType(enum): Oral, Cabotegravir, Lenacapavir, or VaginalRing if PrEP is being used, o/w NoPrEP
EVER_PREP = "ever_prep" # bool: True if an individual has ever been on PrEP
FIRST_ORAL_START_DATE = "first_oral_start_date" # None | date: start date of first ever oral PrEP usage
FIRST_CAB_START_DATE = "first_cab_start_date" # None | date: start date of first ever injectable Cab PrEP usage
FIRST_LEN_START_DATE = "first_len_start_date" # None | date: start date of first ever injectable Len PrEP usage
FIRST_VR_START_DATE = "first_vr_start_date" # None | date: start date of first ever vaginal ring PrEP usage
LAST_PREP_START_DATE = "last_prep_start_date" # None | date: start date of most recent PrEP usage
PREP_JUST_STARTED = "prep_just_started" # Bool: True if PrEP usage began this time step
PREP_JUST_STARTED = "prep_just_started" # bool: True if PrEP usage began this time step
LAST_PREP_USE_DATE = "last_prep_use_date" # None | date: most recent date of PrEP usage
LAST_PREP_STOP_DATE = "last_prep_stop_date" # None | date: stop date of most recent PrEP usage
PREP_PAUSED = "prep_paused" # Bool: True if PrEP usage is paused this time step due to ineligibility
ON_PREP = "on_prep" # Bool: True if an individual is currently on PrEP this time step
PREP_PAUSED = "prep_paused" # bool: True if PrEP usage is paused this time step due to ineligibility
ON_PREP = "on_prep" # bool: True if an individual is currently on PrEP this time step
CONT_ON_PREP = "cont_on_prep" # None | timedelta: total length of continuous usage of current PrEP based on user intention (breaks due to ineligibility do not count against continuity - this value will not be reset during an ineligibility break)
CONT_INTENT_ON_PREP = "cont_intent_on_prep" # None | timedelta: total length of continuous usage of current PrEP based on user intention, including pauses (will continue to increment even during ineligibility breaks)
CONT_ACTIVE_ON_PREP = "cont_active_on_prep" # None | timedelta: actual total length of continuous usage of current PrEP
Expand All @@ -143,28 +142,49 @@
CUMULATIVE_PREP_LEN = "cumulative_prep_len" # None | timedelta: total length of cumulative injectable Len PrEP usage
CUMULATIVE_PREP_VR = "cumulative_prep_vr" # None | timedelta: total length of cumulative injectable vaginal ring PrEP usage

ART_ADHERENCE = "art_adherence" # None | Float: percentage of ART intake that is adhered to
TA_MUTATION = "tam" # X_MUTATION: drug resistance cols (TODO: all 24 currently DUMMIED)
M184_MUTATION = "m184m"
K65_MUTATION = "k65m"
Q151_MUTATION = "q151m"
K103_MUTATION = "k103m"
Y181_MUTATION = "y181m"
G190_MUTATION = "g190m"
P32_MUTATION = "p32m"
P33_MUTATION = "p33m"
P46_MUTATION = "p46m"
P47_MUTATION = "p47m"
P50L_MUTATION = "p50lm"
P50V_MUTATION = "p50vm"
P54_MUTATION = "p54m"
P76_MUTATION = "p76m"
P82_MUTATION = "p82m"
P84_MUTATION = "p84m"
P88_MUTATION = "p88m"
P90_MUTATION = "p90m"
IN118_MUTATION = "in118m"
IN140_MUTATION = "in140m"
IN148_MUTATION = "in148m"
IN155_MUTATION = "in155m"
IN263_MUTATION = "in263m"
ART_NAIVE = "art_naive" # bool: True if person has never been on antiretroviral therapy
ON_ART = "on_art" # bool: True if a person is currently on ART
CONT_ON_ART = "cont_on_art" # None | timedelta: total length of continuous time on current line of ART
CONT_ON_ARV = "cont_on_arv" # None | timedelta: total length of continuous time on antiretroviral drugs (PrEP or ART)
ART_ADHERENCE = "art_adherence" # None | float: percentage of ART intake that is adhered to
NUM_ACTIVE_DRUGS = "num_active_drugs" # int: number of active drugs in an individual's regimen

ON_ZDV = "on_zdv" # ON_X: True if individual is on a particular antiretroviral drug (TODO: all currently DUMMIED)
ON_3TC = "on_3tc"
ON_TEN = "on_ten"
ON_NEV = "on_nev"
ON_DAR = "on_dar"
ON_EFA = "on_efa"
ON_LPR = "on_lpr"
ON_TAZ = "on_taz"
ON_DOL = "on_dol"
ON_CAB = "on_cab"
ON_LEN = "on_len"
ON_OLE = "on_ole"
ON_ISL = "on_isl"

RESISTANCE_MUTATIONS = "resistance_mutations" # int: total number of resistance mutations in an individual
RTTA_MUTATIONS = "rttams" # int: number of RT (reverse transcriptase) gene TA mutations
RT184_MUTATION = "rt184m" # bool: True if an individual has the RT gene M184 mutation
RT65_MUTATION = "rt65m" # bool: True if an individual has the RT gene K65 mutation
RT151_MUTATION = "rt151m" # bool: True if an individual has the RT gene Q151 mutation
RT103_MUTATION = "rt103m" # bool: True if an individual has the RT gene K103 mutation
RT181_MUTATION = "rt181m" # bool: True if an individual has the RT gene Y181 mutation
RT190_MUTATION = "rt190m" # bool: True if an individual has the RT gene G190 mutation
PR32_MUTATION = "pr32m" # bool: True if an individual has the PR (protease) gene P32 mutation
PR33_MUTATION = "pr33m" # bool: True if an individual has the PR gene P33 mutation
PR46_MUTATION = "pr46m" # bool: True if an individual has the PR gene P46 mutation
PR47_MUTATION = "pr47m" # bool: True if an individual has the PR gene P47 mutation
PR50L_MUTATION = "pr50lm" # bool: True if an individual has the PR gene P50L mutation
PR50V_MUTATION = "pr50vm" # bool: True if an individual has the PR gene P50V mutation
PR54_MUTATION = "pr54m" # bool: True if an individual has the PR gene P54 mutation
PR76_MUTATION = "pr76m" # bool: True if an individual has the PR gene P76 mutation
PR82_MUTATION = "pr82m" # bool: True if an individual has the PR gene P82 mutation
PR84_MUTATION = "pr84m" # bool: True if an individual has the PR gene P84 mutation
PR88_MUTATION = "pr88m" # bool: True if an individual has the PR gene P88 mutation
PR90_MUTATION = "pr90m" # bool: True if an individual has the PR gene P90 mutation
IN118_MUTATION = "in118m" # bool: True if an individual has the integrase inhibitor IN118 mutation
IN140_MUTATION = "in140m" # bool: True if an individual has the integrase inhibitor IN140 mutation
IN148_MUTATION = "in148m" # bool: True if an individual has the integrase inhibitor IN148 mutation
IN155_MUTATION = "in155m" # bool: True if an individual has the integrase inhibitor IN155 mutation
IN263_MUTATION = "in263m" # bool: True if an individual has the integrase inhibitor IN263 mutation
Loading
Loading