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

malaria hiv interactions #1101

Merged
merged 39 commits into from
Feb 13, 2024
Merged

malaria hiv interactions #1101

merged 39 commits into from
Feb 13, 2024

Conversation

tdm32
Copy link
Collaborator

@tdm32 tdm32 commented Sep 7, 2023

This branch incorporates interactions between malaria and HIV.

Specific changes are:

  • Include property for cotrimoxazole (BOOL) so we can include protective effects of this on malaria
  • Edit ART dispensation to track cotrim as well
  • Cotrim is optional item in consumables check
  • Only give cotrim if not on IPTp already (pregnant)
  • Only give IPTp if not on cotrim - add in check
  • Add linear models to incorporate individual risk for clinical and severe malaria
  • Add effects of HIV to malaria incidence draws
  • Add effects of HIV to malaria severity draws
  • cotrim and IPTp now give partial protection against clinical/severe malaria through linear model
  • End protection of IPTp after 6weeks - change property
  • Edit malaria tests to pass under new edits

Plots below are small population (2000) and show some stochastic noise but are within reasonable tolerance of reported data.

image
image
image
image

@tdm32 tdm32 requested a review from tbhallett September 7, 2023 12:58
tdm32 and others added 9 commits September 7, 2023 14:00
make test for linear model harder - set whole population to be at risk of clinical/severe malaria and allow iptp to have protective effect
make test for linear model harder - set whole population to be at risk of clinical/severe malaria and allow iptp to have protective effect
@tbhallett
Copy link
Collaborator

tbhallett commented Feb 6, 2024

Tests are failing on this one. Investigating....

..... One problem is that hv_on_cotrimoxazole (defined as type bool) is being written to as "not" at some point (line 1355 in hiv.py), so its type changes (and probably other logic breaks down too) [This is person 997 in test_cause_of_death_being_registered]

... pushing a quick fix for that, to see if that solves everything magically!

@tbhallett
Copy link
Collaborator

Wow. It did!

@tdm32
Copy link
Collaborator Author

tdm32 commented Feb 7, 2024

Wow. It did!

Ah great thanks Tim.

@tdm32
Copy link
Collaborator Author

tdm32 commented Feb 8, 2024

@tbhallett I'm just working on this - in another branch - where I'm decoupling malaria from HIV and TB. Any conditions which are reliant on properties set by module Hiv now have checks, so you can run malaria with or without Hiv

Update: This is now committed to this branch.

Allow malaria to run without HIV (which also requires TB)
@tbhallett
Copy link
Collaborator

Thanks. So this is ready for review and merging?

@tdm32
Copy link
Collaborator Author

tdm32 commented Feb 8, 2024

Thanks. So this is ready for review and merging?

Yes please

@@ -2534,13 +2541,15 @@ def do_at_initiation(self, person_id):
df = self.sim.population.props
person = df.loc[person_id]

# Check if drugs are available, and provide drugs:
# Check if drugs are available, and provide drugs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be safer for this to be dict or named tuple so that we don't have to remember the special ordering.
Ie for example return
{"art": True, "contrim": False}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed this

)

# prevalence of malaria in HIV population
prev_malaria_in_hiv_population = coinfection_num / hiv_infected
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Careful about division of values than could be 0. Use safety around this: eg

X if y > 0 else 0

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

df[df.is_alive & (df.ma_inf_type != 'none')]
)

prop_malaria_cases_with_hiv = coinfection_num / malaria_infected
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above and elsewhere

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed here and wherever appropriate

@tdm32
Copy link
Collaborator Author

tdm32 commented Feb 9, 2024

@tbhallett the suggested changes have been made and this is ready for final review. Thanks very much!

@tbhallett
Copy link
Collaborator

Thanks @tdm32 --- there's a conflict on this branch now. (ResourceFile_malaria.xlsx ... so it's hard for me to work out which version to choose). Please could you resolve through merging-in master?

@tdm32
Copy link
Collaborator Author

tdm32 commented Feb 12, 2024

Thanks @tdm32 --- there's a conflict on this branch now. (ResourceFile_malaria.xlsx ... so it's hard for me to work out which version to choose). Please could you resolve through merging-in master?

Hi @tbhallett, I've merged in master this morning. The conflict arose I think because the file location moved. The correct version is in this branch.

@tbhallett tbhallett merged commit 864fa9c into master Feb 13, 2024
56 checks passed
@tbhallett tbhallett deleted the tara_malaria_hiv_interactions branch February 13, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants