resistance.analyzers

resistance.analyzers

Analyzers for multi-strain (drug-resistance) TB.

Classes

Name Description
ResistanceStats Records the resistance observables of the reference ODE (tbsim.compartmental.TwoStrainODE):
StrainResults Per-strain active-TB carrier counts — one result channel per strain, labeled by the strain’s

ResistanceStats

resistance.analyzers.ResistanceStats()

Records the resistance observables of the reference ODE (tbsim.compartmental.TwoStrainODE): resistant and superinfected fractions of active TB, and the resistance-origin flux decomposition — new resistant cases arising from (i) de-novo mutation, (ii) treatment-acquired resistance, (iii) TPT-acquired resistance, and (iv) transmission.

TBResistant already logs frac_resist/frac_super and the de-novo and transmitted fluxes in its own results; this analyzer collates them with the treatment-acquired flux (summed over any TxDeliveryR interventions) and the TPT-acquired flux (summed over any TPTRx products) into one place, and exposes to_df() for like-for-like comparison against the ODE.

Methods

Name Description
to_df Return the recorded observables as a tidy DataFrame indexed by time (pass the finished sim).
to_df
resistance.analyzers.ResistanceStats.to_df(sim)

Return the recorded observables as a tidy DataFrame indexed by time (pass the finished sim).

StrainResults

resistance.analyzers.StrainResults()

Per-strain active-TB carrier counts — one result channel per strain, labeled by the strain’s resistance profile (e.g. n_active_pan, n_active_RIF_FQ). Complements TBResistant’s aggregate frac_resist/frac_resist_<drug> with resolution over individual strains.