malaria_config
DoseFractionByAge
Pediatric dosing fraction for a specific age cutoff. Children below upper_age_in_years receive fraction_of_adult_dose of the adult dose.
Schema type: idmType:DoseFractionByAge
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
upper_age_in_years
|
float
|
Age in years below which children receive a reduced dose. Minimum value: 0 Maximum value: 125 |
required |
fraction_of_adult_dose
|
float
|
Fraction of the adult dose given to children below the specified age. Minimum value: 0 Maximum value: 1 |
required |
Source code in emodpy_malaria/drug_config.py
DrugModifier
Drug resistance modifier applied when a parasite genome matches the specified resistant string. Multiple matching modifiers are multiplied together.
Schema type: idmType:DrugModifier
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
drug_resistant_string
|
str
|
Nucleotide base letters (A, C, G, T) defining resistance at specific genome locations. |
required |
pkpd_c50_modifier
|
float
|
Multiplier applied to the drug's Drug_PKPD_C50. Minimum value: 0 Maximum value: 1000 Default value: 1.0 |
1.0
|
max_irbc_kill_modifier
|
float
|
Multiplier applied to the drug's Max_Drug_IRBC_Kill. Minimum value: 0 Maximum value: 1000 Default value: 1.0 |
1.0
|
Source code in emodpy_malaria/drug_config.py
MalariaDrugTypeParameters
Schema-backed malaria drug type configuration. Encapsulates all pharmacokinetic/ pharmacodynamic parameters for a single antimalarial drug.
Schema type: idmType:MalariaDrugTypeParameters
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
(str, required)
|
Drug name. Must be unique across all configured drugs. |
required |
pkpd_model
|
Union[PKPDModel, str]
|
PK/PD model type. Use
|
FIXED_DURATION_CONSTANT_EFFECT
|
drug_cmax
|
float
|
Maximum drug concentration after a treatment
dose (mg/L). Only used when pkpd_model is
|
1000
|
drug_decay_t1
|
float
|
First-phase exponential decay rate (days). Minimum value: 0 Maximum value: 100000 Default value: 1 |
1
|
drug_decay_t2
|
float
|
Second-phase exponential decay rate (days). Minimum value: 0 Maximum value: 100000 Default value: 1 |
1
|
drug_vd
|
float
|
Volume of distribution (L/kg). Only used when
pkpd_model is |
10
|
drug_pkpd_c50
|
float
|
Drug concentration at which killing rate is
50% of maximum (mg/L). Only used when pkpd_model is
|
100
|
drug_fulltreatment_doses
|
int
|
Number of doses in a full treatment course. Minimum value: 1 Maximum value: 100000 Default value: 3 |
3
|
drug_dose_interval
|
float
|
Days between doses. Minimum value: 0 Maximum value: 100000 Default value: 1 |
1
|
drug_gametocyte02_killrate
|
float
|
Kill rate for stage 0–2 gametocytes. Minimum value: 0 Maximum value: 100000 Default value: 0 |
0
|
drug_gametocyte34_killrate
|
float
|
Kill rate for stage 3–4 gametocytes. Minimum value: 0 Maximum value: 100000 Default value: 0 |
0
|
drug_gametocytem_killrate
|
float
|
Kill rate for mature gametocytes. Minimum value: 0 Maximum value: 100000 Default value: 0 |
0
|
drug_hepatocyte_killrate
|
float
|
Kill rate for hepatocytes (liver stage). Minimum value: 0 Maximum value: 100000 Default value: 0 |
0
|
max_drug_irbc_kill
|
float
|
Maximum kill rate for infected red blood cells. Minimum value: 0 Maximum value: 100000 Default value: 5 |
5
|
bodyweight_exponent
|
float
|
Exponent for body-weight-based dosing adjustment. Minimum value: 0 Maximum value: 100000 Default value: 0 |
0
|
fractional_dose_by_upper_age
|
list[DoseFractionByAge]
|
Pediatric dosing fractions by age. Default value: [] |
None
|
resistances
|
list[DrugModifier]
|
Drug resistance modifiers for parasite genetics simulations. Default value: [] |
None
|
Source code in emodpy_malaria/drug_config.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 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 | |
VectorHabitat
Defines a vector larval habitat entry for a species' Habitats list.
Each habitat has a type, a maximum larval capacity, and — for
LINEAR_SPLINE habitats — a time-varying capacity distribution.
For non-spline habitat types (TEMPORARY_RAINFALL, WATER_VEGETATION,
HUMAN_POPULATION, CONSTANT, BRACKISH_SWAMP), only
habitat_type and max_larval_capacity are needed.
For LINEAR_SPLINE, capacity_distribution_over_time is required
and capacity_distribution_number_of_years may optionally be set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
habitat_type
|
(Union[HabitatType, str], required)
|
The type of larval habitat. Use HabitatType
enum values (e.g. |
required |
max_larval_capacity
|
(float, required)
|
The maximum larval capacity for this habitat. |
required |
capacity_distribution_over_time
|
Union[ValueMap, dict]
|
Required when Example:: |
None
|
capacity_distribution_number_of_years
|
int
|
Only used when |
1
|
Example
Seasonal habitat with a linear spline::
from emodpy_malaria.vector_config import VectorHabitat
from emodpy_malaria.utils.emod_enum import HabitatType
habitat = VectorHabitat(
habitat_type=HabitatType.LINEAR_SPLINE,
max_larval_capacity=1e8,
capacity_distribution_over_time={
"Times": [0, 30, 60, 91, 122, 152, 182, 213, 243, 274, 304, 334, 365],
"Values": [3, 0.8, 1.25, 0.1, 2.7, 8, 4, 35, 6.8, 6.5, 2.6, 2.1, 2]
}
)
Example
Simple constant habitat::
habitat = VectorHabitat(
habitat_type=HabitatType.CONSTANT,
max_larval_capacity=1e7
)
Source code in emodpy_malaria/vector_config.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 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 | |
VectorSpeciesParameters
Defines a vector species and its biological parameters for use in Vector_Species_Params. Each species entry controls mosquito behavior: feeding preferences, life expectancy, habitat, transmission efficiency, and temperature-dependent development rates.
Use the constructor to create a species from scratch, or use
from_preset() to start from a built-in species template
(gambiae, arabiensis, funestus, etc.) and override selected parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
(str, required)
|
Name of the vector species. Must be unique within the simulation's Vector_Species_Params list. |
required |
habitats
|
(list[VectorHabitat], required)
|
List of VectorHabitat objects defining the larval habitat types and capacities for this species. |
required |
anthropophily
|
float
|
Fraction of blood meals taken from humans vs. animals. Default value: 0.65 |
0.65
|
indoor_feeding_fraction
|
float
|
Fraction of human feeds that occur indoors. Default value: 0.95 |
0.95
|
adult_life_expectancy
|
float
|
Average female mosquito lifespan in days. Default value: 20 |
20
|
male_life_expectancy
|
float
|
Average male mosquito lifespan in days. Default value: 10 |
10
|
transmission_rate
|
float
|
Probability that a bite from an infectious mosquito infects a naive, uninfected individual. Default value: 0.9 |
0.9
|
acquire_modifier
|
float
|
Modifier of the probability that a mosquito becomes infected when feeding on an infectious human. Default value: 0.8 |
0.8
|
egg_batch_size
|
float
|
Number of eggs laid per successful blood meal. Default value: 100 |
100
|
days_between_feeds
|
float
|
Average number of days between blood-feeding attempts. Default value: 3 |
3
|
aquatic_mortality_rate
|
float
|
Base daily mortality rate for aquatic-stage larvae. Default value: 0.1 |
0.1
|
immature_duration
|
float
|
Days for larvae to develop into adults. Default value: 2 |
2
|
infected_egg_batch_factor
|
float
|
Multiplier on egg batch size for infected females. Default value: 0.8 |
0.8
|
infectious_human_feed_mortality_factor
|
float
|
Multiplier on feeding mortality for infected mosquitoes. Default value: 1.5 |
1.5
|
vector_sugar_feeding_frequency
|
str
|
Sugar-feeding behavior. One of |
'VECTOR_SUGAR_FEEDING_NONE'
|
Example
Create a custom species with a seasonal spline habitat::
habitat = VectorHabitat(HabitatType.LINEAR_SPLINE,
max_larval_capacity=1e8,
capacity_distribution_over_time={...})
species = VectorSpeciesParameters(name="gambiae",
habitats=[habitat],
anthropophily=0.65,
indoor_feeding_fraction=0.95)
config.parameters.Vector_Species_Params.append(species.to_schema_dict())
Example
Load a built-in preset and override one parameter::
species = VectorSpeciesParameters.from_preset(campaign, manifest, "arabiensis")
species.indoor_feeding_fraction = 0.3
config.parameters.Vector_Species_Params.append(species.to_schema_dict())
Source code in emodpy_malaria/vector_config.py
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 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 | |
from_preset(campaign, manifest, species_name)
classmethod
Create a VectorSpeciesParameters from a built-in species preset.
Built-in species: gambiae, arabiensis, funestus, fpg_gambiae, minimus, dirus.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
object
|
An instance of the emod_api.campaign module. |
required |
manifest
|
object
|
Manifest module containing the schema path. |
required |
species_name
|
str
|
Name of a built-in species. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
VectorSpeciesParameters |
VectorSpeciesParameters
|
An instance with preset values that |
VectorSpeciesParameters
|
can be modified before calling |
Source code in emodpy_malaria/vector_config.py
add_blood_meal_mortality(config, manifest, species, allele_combo, default_probability_of_death, probability_of_death_for_allele_combo)
Add a probability of death after a mosquito has a blood meal. There are some genetically modified mosquitoes that have a fitness cost associated with the digestion of a blood meal. This affects vectors whether this is a human or animal blood meal. This is a GeneticProbability such that the probability used can depend on the genetic makeup of the mosquito. The deaths from this are added to the "die after feeding" numbers for vectors that have fed on humans and "die before feeding on a human" for vectors that die after animal blood meal.
If you need to add multiple allele combos for the same species, call this method once for each allele combo and associated probability. If you do, please note that the default probability will be combined by OR'ing the different values together [1-((1-p1)*(1-p2))]. Also note that the default probabilities for each species will be OR'd together.
The probability selected for given genome will depend on the "complexity" of the allele combinations. If an entry has more genes/loci positions than another, the combination with more will be considered first. If they have the same number of genes and one has fewer possible genomes, the one with fewer possible genomes will be considered first. For example, if you add a1-a1 in one call and b1-b0 in a second call, EMOD will first check if the genome has a1-a1. If it has a1-a1, it will get that probability. If it does not, it will check if the genome has b1-b0 or b0-b1. The entered values are not combined in any way. It is up to the user to specify the probability for specific combinations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
schema-backed config smart dict |
required |
manifest
|
ModuleType
|
manifest module containing the schema path |
required |
species
|
str
|
Name of the species of vectors to give the specific probability to. |
required |
allele_combo
|
list
|
The combination of alleles that a mosquito's genome must have in order to apply associated probability. You do not need to specify alleles for every locus. The ones not defined are not considered in the match This should be a two-dimensional array where each internal array has two strings representing two alleles of the same locus. Each separate internal array represents locus, and you can only have one entry per locus. You can use '' for an allele to say any allele. For example, [ ["a1", "a1"], ["b1, ""] ] says any mosquito with a1-a1 in the first locus and b1 in either chromosome of the second locus. |
required |
default_probability_of_death
|
float
|
The probability used if the genome of the mosquito does not match any of the defined allele combinations in Genetic_Probabilities. |
required |
probability_of_death_for_allele_combo
|
float
|
The probability to use if the genome of the mosquito has the matching Allele_Combinations. The default is zero. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
configured config |
Source code in emodpy_malaria/vector_config.py
add_drug_resistance(config, manifest, drugname, drug_resistant_string, pkpd_c50_modifier=1.0, max_irbc_kill_modifier=1.0)
Adds a drug resistance modifier to an existing drug in the simulation config.
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 |
required |
drug_resistant_string
|
str
|
Nucleotide base letters (A, C, G, T) representing resistance at specific genome locations. |
required |
pkpd_c50_modifier
|
float
|
Multiplier applied to the drug's Drug_PKPD_C50 when the parasite genome matches. Genomes with multiple markers have modifiers multiplied together. Default: 1.0. |
1.0
|
max_irbc_kill_modifier
|
float
|
Multiplier applied to the drug's Max_Drug_IRBC_Kill when the parasite genome matches. Default: 1.0. |
1.0
|
Returns:
| Type | Description |
|---|---|
dict
|
configured config |
Source code in emodpy_malaria/malaria_config.py
add_genes_and_alleles(config, manifest, species, alleles)
Adds alleles to a species
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
schema-backed config smart dict |
required |
manifest
|
ModuleType
|
manifest file containing the schema path |
required |
species
|
str
|
species to which to assign the alleles |
required |
alleles
|
list[tuple]
|
List of tuples of (Name, Initial_Allele_Frequency, Is_Y_Chromosome) for a set of alleles or (Name, Initial_Allele_Frequency), 1/0 or True/False can be used for Is_Y_Chromosome, third parameter is assumed False (0). If the third parameter is set to 1 in any of the tuples, we assume, this is a gender gene. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
configured config |
Source code in emodpy_malaria/vector_config.py
add_insecticide_resistance(config, manifest, insecticide_name, species, allele_combo, blocking=1.0, killing=1.0, repelling=1.0, larval_killing=1.0)
Use this function to add to the list of **Resistances** parameter for a specific insecticide
Add each resistance separately.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
schema-backed config smart dict |
required |
manifest
|
ModuleType
|
manifest file containing the schema path |
required |
insecticide_name
|
str
|
The name of the insecticide to which attach the resistance. |
required |
species
|
str
|
Name of the species of vectors. Must be one of the species defined for this simulation. |
required |
allele_combo
|
list[list[str]]
|
List of combination of alleles that vectors must have in order to be resistant. All the genes defined for the species must be present in the combo, but not all the alleles need to be defined. You can use * symbol for alleles to say any allele. For example, [[a1,a1],[b0,*]] matches any vector with a1-a1 in the first gene and b0 in the second gene regardless of the other b-gene allele. |
required |
blocking
|
float
|
The value used to modify (multiply) the blocking effectivity of an intervention. The intervention must have a blocking effect for this to have an effect. Default is 1, values less than 1 reduce the effectivity, and values greater than 1 increase the effectivity. |
1.0
|
killing
|
float
|
The value used to modify (multiply) the killing effectivity of an intervention. The intervention must have a killing effect for this to have an effect. Default is 1, values less than 1 reduce the effectivity, and values greater than 1 increase the effectivity. |
1.0
|
repelling
|
float
|
The value used to modify (multiply) the repelling effectivity of an intervention. The intervention must have a repelling effect for this to have an effect. Default is 1, values less than 1 reduce the effectivity, and values greater than 1 increase the effectivity. |
1.0
|
larval_killing
|
float
|
The value used to modify (multiply) the larval killing effectivity of an intervention. The intervention must have a larval killing effect for this to have an effect (e.g. larvicides). Default is 1, values less than 1 reduce the effectivity, and values greater than 1 increase the effectivity. |
1.0
|
Returns:
| Type | Description |
|---|---|
dict
|
configured config |
Source code in emodpy_malaria/vector_config.py
add_maternal_deposition(config, manifest, species, cas9_grna_from, allele_to_cut, likelihood_list)
Adds a maternal deposition element for the specified species.
After meiosis and fertilization, maternal deposition of Cas9 and gRNA can form additional drive-resistant alleles
in the zygote or early embryo from wildtype alleles. These elements define the likelihoods of forming additional
drive-resistant alleles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
schema-backed config smart dict |
required |
manifest
|
ModuleType
|
manifest file containing the schema path |
required |
species
|
str
|
Name of the species for which we're adding the maternal deposition element. |
required |
cas9_grna_from
|
str
|
This is an allele for presence of which in the mother we will be checking to see if additional resistance alleles will be formed. This is the allele must be one of the 'driving_alleles' from vector_config.add_species_drivers() function. |
required |
allele_to_cut
|
str
|
The allele from which resistance alleles might be formed due to maternal deposition. This must be one of the 'to_replace' alleles defined in the vector_config.add_species_drivers() function. |
required |
likelihood_list
|
list
|
A list of tuples in format: [( |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Config object with maternal deposition parameters added for the specified species. |
Source code in emodpy_malaria/vector_config.py
975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 | |
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
|
Union[ValueMap, dict]
|
Microsporidia_Duration_To_Disease_Acquisition_Modification,
a ValueMap or a dict with "Times" and "Values" keys
as an age-based modification that the female will acquire malaria.
Times is an array of days in ascending order since infection. Values are probabilities (0-1).
Defaults to |
None
|
duration_to_disease_transmission_modification
|
Union[ValueMap, dict]
|
Microsporidia_Duration_To_Disease_Transmission_Modification,
a ValueMap or a dict with "Times" and "Values" keys
as an age-based modification that the female will transmit malaria.
Times is an array of days in ascending order since infection. Values are probabilities (0-1).
Defaults to |
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/vector_config.py
1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 | |
add_mutation(config, manifest, species, mutate_from, mutate_to, probability)
Adds to Mutations parameter in a Gene which has the matching Alleles
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
schema-backed config smart dict |
required |
manifest
|
ModuleType
|
manifest file containing the schema path |
required |
species
|
str
|
Name of vector species to which we're adding mutations |
required |
mutate_from
|
str
|
The allele in the gamete that could mutate |
required |
mutate_to
|
str
|
The allele that this locus will change to during gamete generation |
required |
probability
|
float
|
The probability that the allele will mutate from one allele to the other during the creation of the gametes |
required |
Returns:
| Type | Description |
|---|---|
dict
|
configured config |
Source code in emodpy_malaria/vector_config.py
add_new_drug(config, manifest, drug, overwrite=False)
Adds a new drug to the simulation's Malaria_Drug_Params list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
schema-backed config smart dict |
required |
manifest
|
ModuleType
|
manifest file containing the schema path |
required |
drug
|
MalariaDrugTypeParameters
|
fully configured drug object |
required |
overwrite
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
dict
|
configured config |
Example::
drug = MalariaDrugTypeParameters(
name="MyNewDrug",
pkpd_model=PKPDModel.CONCENTRATION_VERSUS_TIME,
drug_cmax=200,
drug_decay_t1=0.5,
max_drug_irbc_kill=6.0,
)
add_new_drug(config, manifest, drug)
Source code in emodpy_malaria/malaria_config.py
add_species(config, manifest, species_to_select)
Adds species with preset parameters from 'malaria_vector_species_params.py', if species name not found - "gambiae" parameters are added and the new species name assigned.
Also accepts VectorSpeciesParameters objects directly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
object
|
schema-backed config smart dict |
required |
manifest
|
object
|
manifest file containing the schema path |
required |
species_to_select
|
Union[str, list, VectorSpeciesParameters, list]
|
a list of species names, a single species name, or one or more VectorSpeciesParameters objects. |
required |
Returns:
| Type | Description |
|---|---|
object
|
configured config |
Source code in emodpy_malaria/vector_config.py
add_species_drivers(config, manifest, species=None, driving_allele=None, driver_type='CLASSIC', to_copy=None, to_replace=None, likelihood_list=None, shredding_allele_required=None, allele_to_shred=None, allele_to_shred_to=None, allele_shredding_fraction=None, allele_to_shred_to_surviving_fraction=None)
Add a gene drive that propagates a particular set of alleles.
Adds one **Alleles_Driven** item to the **Alleles_Driven** list, using 'driving_allele' as key if matching one
already exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
schema-backed config smart dict |
required |
manifest
|
ModuleType
|
manifest file containing the schema path |
required |
species
|
str
|
Name of the species for which we're setting the drivers |
None
|
driving_allele
|
str
|
This is the allele that is known as the driver |
None
|
driver_type
|
str
|
This indicates the type of driver. CLASSIC - The driver can only drive if the one gamete has the driving allele and the other has a specific allele to be replaced INTEGRAL_AUTONOMOUS - At least one of the gametes must have the driver. Alleles can still be driven if the driving allele is in both gametes or even if the driving allele cannot replace the allele in the other gamete X_SHRED, Y_SHRED - cannot be used in the same species during one simulation/realization. The driving_allele must exist at least once in the genome for shredding to occur. If there is only one, it can exist in either half of the genome. DAISY_CHAIN - can be used for drives that do not drive themselves but can be driven by another allele. |
'CLASSIC'
|
to_copy
|
str
|
The main allele to be copied Allele_To_Copy |
None
|
to_replace
|
str
|
The allele that must exist and will be replaced by the copy Allele_To_Replace |
None
|
likelihood_list
|
list
|
A list of tuples in format: [(Copy_To_Allele, Likelihood),(),()] to assign to Copy_To_Likelyhood list |
None
|
shredding_allele_required
|
str
|
The genome must have this gender allele in order for shredding to occur. If the driver is X_SHRED, then the allele must be designated as a Y chromosome. If the driver is Y_SHRED, then the allele must NOT be designated as a Y chromosome |
None
|
allele_to_shred
|
str
|
The genome must have this gender allele in order for shredding to occur. If the driver is X_SHRED, then the allele must NOT be designated as a Y chromosome. If the driver is Y_SHRED, then the allele must be designated as a Y chromosome |
None
|
allele_to_shred_to
|
str
|
This is a gender allele that the 'shredding' will change the allele_to_shred into. It can be a temporary allele that never exists in the output or could be something that appears due to resistance/failures |
None
|
allele_shredding_fraction
|
float
|
This is the fraction of the alleles_to_Shred that will be converted to allele_to_shred_to. Values 0 to 1. If this value is less than 1, then some of the allele_to_shred will remain and be part of the gametes. |
None
|
allele_to_shred_to_surviving_fraction
|
float
|
A trait modifier will automatically generated for [ Allele_To_Shred_To, * ], the trait ADJUST_FERTILE_EGGS, and this value as its modifier. Values 0 to 1. A value of 0 implies perfect shredding such that no allele_to_Shred_To survive in the eggs. A value of 1 means all of the 'shredded' alleles survive. |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
configured config |
Source code in emodpy_malaria/vector_config.py
826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 | |
add_trait(config, manifest, species, allele_combo=None, trait_modifiers=None)
Use this function to add traits as part of vector genetics configuration, the trait is assigned to the species' Gene_To_Trait_Modifiers parameter
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
schema-backed config smart dict |
required |
manifest
|
ModuleType
|
manifest file containing the schema path |
required |
species
|
str
|
Name of species for which to add this Gene_To_Trait_Modifiers |
required |
allele_combo
|
list
|
List of lists, This defines a possible subset of allele pairs that a vector could have. Each pair are alleles from one gene. If the vector has this subset, then the associated traits will be adjusted. Order does not matter. '*' is allowed when only the occurrence of one allele is important. Example:: [[ "X", "X" ], [ "a0", "a1" ]] |
None
|
trait_modifiers
|
list
|
list of trait modifier parameters created with create_trait() function. |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
configured config |
Source code in emodpy_malaria/vector_config.py
add_vector_migration(task, species=None, vector_migration_data=None, vector_migration_filename_path=None, x_vector_migration=1)
Adds vector migration parameters to the named species' parameters and adds the migration file to the common_assets in task.
.. deprecated::
Use MalariaDemographics.add_vector_migration() instead, which follows the
deferred implicit pattern and does not require a task object upfront.
Provide either vector_migration_data (a VectorMigrationData object) or
vector_migration_filename_path (path to an existing binary file), not both.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task
|
EMODTask
|
contains config to edit and assets to add migration file to |
required |
species
|
str
|
Species to target, Name parameter |
None
|
vector_migration_data
|
object
|
VectorMigrationData object. If provided, writes the binary file and registers it with the task. |
None
|
vector_migration_filename_path
|
str
|
Path with the filename of the migration file to use to avoid importing and writing the file from a VectorMigrationData object. If provided, registers the file with the task. |
None
|
x_vector_migration
|
float
|
Scale factor for the rate of vector migration to other nodes. |
1
|
Source code in emodpy_malaria/vector_config.py
create_trait(manifest, trait=None, modifier=None, sporozoite_barcode_string=None, gametocyte_a_barcode_string=None, gametocyte_b_barcode_string=None)
Configures and returns a modifier trait.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manifest
|
ModuleType
|
manifest file containing the schema path |
required |
trait
|
str
|
The trait to be modified of vectors with the given allele combination. Available traits are: "INFECTED_BY_HUMAN", "FECUNDITY", "FEMALE_EGG_RATIO", "STERILITY", "TRANSMISSION_TO_HUMAN", "ADJUST_FERTILE_EGGS", "MORTALITY", "INFECTED_PROGRESS", "OOCYST_PROGRESSION", "SPOROZOITE_MORTALITY" |
None
|
modifier
|
float
|
The multiplier to use to modify the given trait for vectors with the given allele combination. |
None
|
sporozoite_barcode_string
|
str
|
TBD |
None
|
gametocyte_a_barcode_string
|
str
|
TBD |
None
|
gametocyte_b_barcode_string
|
str
|
TBD |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
trait parameters that can be added to a list and passed to add_trait() function |
Source code in emodpy_malaria/vector_config.py
get_species_params(config, species=None)
Returns the species parameters dictionary with the matching species Name
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
schema-backed config smart dict |
required |
species
|
str
|
Species to look up |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary of species parameters with the matching name |
Source code in emodpy_malaria/vector_config.py
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. The habitat must already
exist in the species' Habitats list (added via add_species()).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
schema-backed config smart dict |
required |
species_name
|
str
|
Name of the vector species to target. |
required |
habitat_type
|
HabitatType
|
The HabitatType of
the habitat to update (e.g. |
required |
max_larval_capacity
|
float
|
New value of Max_Larval_Capacity for the habitat. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the species or habitat type is not found. |
Source code in emodpy_malaria/vector_config.py
set_parasite_genetics_params(config, manifest, var_gene_randomness_type=VarGeneRandomnessType.ALL_RANDOM, sporozoites_per_oocyst=None)
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
|
VarGeneRandomnessType
|
Controls randomness of var genes in new
infections. Defaults to |
ALL_RANDOM
|
sporozoites_per_oocyst
|
BaseDistribution
|
A BaseDistribution that
sets the Sporozoites_Per_Oocyst distribution parameters. Defaults to
|
None
|
Returns:
| Type | Description |
|---|---|
dict
|
configured config |
Source code in emodpy_malaria/malaria_config.py
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 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | |
set_species_param(config, species, parameter, value, overwrite=False)
Sets a parameter value for a specific species.
Raises value error if species not found
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
schema-backed config smart dict |
required |
species
|
str
|
name of species for which to set the parameter |
required |
parameter
|
str
|
parameter to set |
required |
value
|
Union[Any, list[Any]]
|
value to set the parameter to |
required |
overwrite
|
bool
|
if set to True and parameter is a list, overwrites the parameter with value, appends by default |
False
|
Source code in emodpy_malaria/vector_config.py
set_team_defaults(config, manifest)
Set configuration defaults using team-wide values, including drugs and vector species.
Source code in emodpy_malaria/malaria_config.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | |
set_team_drug_params(config, manifest)
Loads antimalarial drug parameters from the bundled CSV and appends them to the simulation config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
schema-backed config smart dict |
required |
manifest
|
ModuleType
|
manifest file containing the schema path |
required |
Returns:
| Type | Description |
|---|---|
dict
|
configured config |