Skip to content

Xin hpv infection process#1860

Draft
tdm32 wants to merge 10 commits into
masterfrom
Xin_HPV_Infection_process
Draft

Xin hpv infection process#1860
tdm32 wants to merge 10 commits into
masterfrom
Xin_HPV_Infection_process

Conversation

@tdm32
Copy link
Copy Markdown
Collaborator

@tdm32 tdm32 commented May 6, 2026

No description provided.

Comment thread src/tlo/methods/hpv.py
Types.REAL,
"Relative risk for HPV acquisition among HIV positive people not on ART",
),
"rr_hpv_hiv_art_unsuppressed": Parameter(
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

is there strong evidence that this value is different to rr_hpb_no_art? If not, then just use the same parameter for both untreated and treated but not virally suppressed

Comment thread src/tlo/methods/hpv.py
Types.REAL,
"Rate ratio for HPV clearance among PLWH not on ART",
),
"rr_clear_hiv_art_unsuppressed": Parameter(
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

as above, would this not be the same value for untreated?

Copy link
Copy Markdown
Collaborator Author

@tdm32 tdm32 left a comment

Choose a reason for hiding this comment

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

@Liuxinac I've added some comments so please have a look through and let me know anything you want to discuss further. It looks great so far and when you've finished the tests, this will be good confirmation that all is working as expected.

Comment thread src/tlo/methods/hpv.py
}

PROPERTIES = {
'hp_is_infected': Property(
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I don't think you need this property as well as the 3 below

Comment thread src/tlo/methods/hpv.py
Types.DATE, 'Date of infection of hr2'),
'hp_date_infected_hr3': Property(
Types.DATE, 'Date of infection of hr3'),
'hp_date_first_infected': Property(
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Instead of this property, you can read the earliest start date from the 3 properties above

Comment thread src/tlo/methods/hpv.py
'hp_persistent_hr3': Property(
Types.BOOL, 'Persistent hr3 infection, duration >= 12 months'),

# "va_hpv": Property(Types.INT, "number of doses of hpv vaccine received"),
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I assume these are here as a reminder for useful properties created by other modules?

Comment thread src/tlo/methods/hpv.py
Types.INT, 'Duration for current hr2 infection'),
'hp_duration_hr3': Property(
Types.INT, 'Duration for current hr3 infection'),
'hp_duration_all_clear': Property(
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure I see the use for this property?

Comment thread src/tlo/methods/hpv.py
u = self.rng.random(size=len(eligible))
infected_this_group = eligible[u < p_init]

for person_id in infected_this_group:
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

you could remove this loop, indexing properties using df.loc[infected_in_this_group,...] and creating an array of previous infection dates with size=infected_in_this_group etc

Comment thread src/tlo/methods/hpv.py
df.at[child_id, 'hp_persistent_hr2'] = False
df.at[child_id, 'hp_persistent_hr3'] = False

def report_daly_values(self):
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

todo - look up DALY values associated with HPV infection (if any)

Comment thread src/tlo/methods/hpv.py
if len(eligible) == 0:
return

# 2. self-clearance
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this feels like a very inefficient way to do this, given the properties for each group, you could do a sweep of all those infected with each group for a certain length of time then determine whether they are cleared or not...?

Comment thread src/tlo/methods/hpv.py
else:
continue

my_age_group = module._get_age_group(df.at[person_id,'age_years'])
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

should this be at the top of this class? You use it before this point (line 668) so it will be using the age group from 6 months ago

Comment thread src/tlo/methods/hpv.py
# prev_female[group] = female_group_inf / len(female_idx) if len(female_idx) > 0 else 0

# 4. new infection
interval_years = 0.5
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

try to avoid hard-coding, if you change the frequency of the event this will no longer be correct

Comment thread src/tlo/methods/hpv.py
module = self.module

eligible = df.index[df.is_alive & (df.age_years >= 15)]
log_data = {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

the logger will automatically output the date so this is not needed

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