malaria_config
Primary module for setting simulation-wide configuration values for a malaria simulation.
Start with team defaults and use the other functions in this module to meet your specific needs, including vector species and larval habitats, drug and parasite parameters, insecticide resistance, microsporidia, and parasite genetics.
add_blood_meal_mortality(config, manifest, default_probability_of_death=0.0, species='', allele_combo=None, probability_of_death_for_allele_combo=0.0)
Pass through for vector version of function.
Source code in emodpy_malaria/malaria_config.py
add_drug_resistance(config, manifest, drugname=None, drug_resistant_string=None, pkpd_c50_modifier=1.0, max_irbc_kill_modifier=1.0)
Adds drug resistances by drug name and parameters
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
schema-backed config smart dict |
required |
manifest
|
ModuleType
|
manifest file containing the schema path |
required |
drugname
|
str
|
name of the drug for which to assign resistances |
None
|
drug_resistant_string
|
str
|
A series of nucleotide base letters (A, C, G, T) that represent the drug resistant values at locations in the genome |
None
|
pkpd_c50_modifier
|
float
|
If the parasite has this genome marker, this value will be multiplied times the 'Drug_PKPD_C50' value of the drug. Genomes with multiple markers will be simply multiplied together |
1.0
|
max_irbc_kill_modifier
|
float
|
If the parasite has this genome marker, this value will be multiplied times the 'Max_Drug_IRBC_Kill' value of the drug. Genomes with multiple markers will be simply multiplied together |
1.0
|
Returns:
| Type | Description |
|---|---|
dict
|
configured config |
Source code in emodpy_malaria/malaria_config.py
add_insecticide_resistance(config, manifest, insecticide_name='', species='', allele_combo=None, blocking=1.0, killing=1.0, repelling=1.0, larval_killing=1.0)
Pass through for vector version of function.
Source code in emodpy_malaria/malaria_config.py
add_microsporidia(config, manifest, species_name=None, strain_name='Strain_A', female_to_male_probability=0, female_to_egg_probability=0, male_to_female_probability=0, male_to_egg_probability=0, duration_to_disease_acquisition_modification=None, duration_to_disease_transmission_modification=None, larval_growth_modifier=1, female_mortality_modifier=1, male_mortality_modifier=1)
Adds microsporidia parameters to the named species' parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
schema-backed config dictionary, written to config.json |
required |
manifest
|
ModuleType
|
file that contains path to the schema file |
required |
species_name
|
str
|
Species to target, Name parameter |
None
|
strain_name
|
str
|
Strain_Name The name/identifier of the collection of transmission parameters. Cannot be empty string |
'Strain_A'
|
female_to_male_probability
|
float
|
Microsporidia_Female_to_Male_Transmission_Probability The probability an infected female will infect an uninfected male. |
0
|
female_to_egg_probability
|
float
|
Microsporidia_Female_To_Egg_Transmission_Probability The probability an infected female will infect her eggs when laying them. |
0
|
male_to_female_probability
|
float
|
Microsporidia_Male_To_Female_Transmission_Probability The probability an infected male will infect an uninfected female |
0
|
male_to_egg_probability
|
float
|
Microsporidia_Male_To_Egg_Transmission_Probability The probability a female that mated with an infected male will infect her eggs when laying them, independent of her being infected and transmitting to her offspring. |
0
|
duration_to_disease_acquisition_modification
|
dict
|
Microsporidia_Duration_To_Disease_Acquisition_Modification, A dictionary for "Times" and "Values" as an age-based modification that the female will acquire malaria. Times is an array of days in ascending order that represent the number of days since the vector became infected. Values is an array of probabilities with values from 0 to 1 where each probability is the probability that the vector will acquire malaria due to Microsporidia. |
None
|
duration_to_disease_transmission_modification
|
dict
|
Microsporidia_Duration_To_Disease_Transmission_Modification, A dictionary for "Times" and "Values" as an age-based modification that the female will transmit malaria. Times is an array of days in ascending order that represent the number of days since the vector became infected. Values is an array of probabilities with values from 0 to 1 where each probability is the probability that the vector will acquire malaria due to Microsporidia. |
None
|
larval_growth_modifier
|
float
|
Microsporidia_Larval_Growth_Modifier A multiplier modifier to the daily, temperature dependent, larval growth progress. |
1
|
female_mortality_modifier
|
float
|
Microsporidia_Female_Mortality_Modifier A multiplier modifier on the death rate for female vectors due to general life expectancy, age, and dry heat |
1
|
male_mortality_modifier
|
float
|
Microsporidia_Male_Mortality_Modifier A multiplier modifier on the death rate for male vectors due to general life expectancy, age, and dry heat |
1
|
Source code in emodpy_malaria/malaria_config.py
add_species(config, manifest, species_to_select)
configure_linear_spline(manifest, max_larval_capacity=pow(10, 8), capacity_distribution_number_of_years=1, capacity_distribution_over_time=None)
Configures and returns a ReadOnlyDict of the LINEAR_SPLINE habitat parameters
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manifest
|
ModuleType
|
manifest file containing the schema path |
required |
max_larval_capacity
|
float
|
The maximum larval capacity. Sets Max_Larval_Capacity |
pow(10, 8)
|
capacity_distribution_number_of_years
|
int
|
The total length of time in years for the scaling. If the simulation goes longer than this time, the pattern will repeat. Ideally, this value times 365 is the last value in 'Capacity_Distribution_Over_Time'. Sets Capacity_Distribution_Number_Of_Years |
1
|
capacity_distribution_over_time
|
dict
|
"This allows one to scale the larval capacity over time. The Times and Values arrays must be the same length where Times is in days and Values are a scale factor per degrees squared. The value is multiplied times the max capacity and 'Node_Grid_Size' squared/4. Ideally, you want the last value to equal the first value if they are one day apart. A point will be added if not. Sets Capacity_Distribution_Over_Time Example:: |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
"LINEAR_SPLINE" parameters to be passed directly to "set_species_params" function |
Source code in emodpy_malaria/malaria_config.py
get_species_params(config, species=None)
set_drug_param(config, drug_name=None, parameter=None, value=None)
Set a drug parameter, by passing in drug name, parameter and the parameter value. Added to facilitate adding drug Resistances, Example::
artemether_drug_resistance = [{
"Drug_Resistant_String": "A",
"PKPD_C50_Modifier": 2.0,
"Max_IRBC_Kill_Modifier": 0.9}]
set_drug_param(cb, drug_name='Artemether', parameter="Resistances", value=artemether_drug_resistance)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
schema-backed config smart dict |
required |
drug_name
|
str
|
The drug that has a parameter to set |
None
|
parameter
|
str
|
The parameter to set |
None
|
value
|
any
|
The new value to set |
None
|
Source code in emodpy_malaria/malaria_config.py
set_max_larval_capacity(config, species_name, habitat_type, max_larval_capacity)
Set the Max_Larval_Capacity for a given species and habitat.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
schema-backed config smart dict |
required |
species_name
|
str
|
string. Species_Name to target. |
required |
habitat_type
|
str
|
enum. Habitat_Type to target. |
required |
max_larval_capacity
|
int
|
integer. New value of Max_Larval_Capacity. |
required |
Source code in emodpy_malaria/malaria_config.py
set_parasite_genetics_params(config, manifest, var_gene_randomness_type='ALL_RANDOM')
Sets up the default parameters for parasite genetics simulations Malaria_Model = "MALARIA_MECHANISTIC_MODEL_WITH_PARASITE_GENETICS"
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
schema-backed config smart dict |
required |
manifest
|
ModuleType
|
schema path container |
required |
var_gene_randomness_type
|
str
|
possible values are "FIXED_NEIGHBORHOOD", "FIXED_MSP", "ALL_RANDOM" (default) |
'ALL_RANDOM'
|
Returns:
| Type | Description |
|---|---|
dict
|
configured config |
Source code in emodpy_malaria/malaria_config.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | |
set_species_param(config, species, parameter, value, overwrite=False)
Pass through for vector version of function.
set_team_defaults(config, manifest)
Set configuration defaults using team-wide values, including drugs and vector species.