emodpy_malaria.malaria_config module#
- emodpy_malaria.malaria_config.get_file_from_http(url)[source]#
Get data files from simple http server.
- emodpy_malaria.malaria_config.set_team_defaults(config, manifest)[source]#
Set configuration defaults using team-wide values, including drugs and vector species.
- emodpy_malaria.malaria_config.set_parasite_genetics_params(config, manifest, var_gene_randomness_type: str = 'ALL_RANDOM')[source]#
Sets up the default parameters for parasite genetics simulations Malaria_Model = “MALARIA_MECHANISTIC_MODEL_WITH_PARASITE_GENETICS”
- Parameters:
config – schema-backed config smart dict
manifest – schema path container
var_gene_randomness_type – possible values are “FIXED_NEIGHBORHOOD”, “FIXED_MSP”, “ALL_RANDOM” (default)
- Returns:
configured config
- emodpy_malaria.malaria_config.set_drug_param(config, drug_name: str | None = None, parameter: str | None = None, value: any | None = None)[source]#
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:
config – schema-backed config smart dict
drug_name – The drug that has a parameter to set
parameter – The parameter to set
value – The new value to set
- Returns:
Nothing or error if drug name is not found
- emodpy_malaria.malaria_config.add_drug_resistance(config, manifest, drugname: str | None = None, drug_resistant_string: str | None = None, pkpd_c50_modifier: float = 1.0, max_irbc_kill_modifier: float = 1.0)[source]#
Adds drug resistances by drug name and parameters
- Parameters:
config – schema-backed config smart dict
manifest – manifest file containing the schema path
drugname – name of the drug for which to assign resistances
drug_resistant_string – A series of nucleotide base letters (A, C, G, T) that represent the drug resistant values at locations in the genome
pkpd_c50_modifier – 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
max_irbc_kill_modifier – 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
- Returns:
configured config
- emodpy_malaria.malaria_config.set_species_param(config, species, parameter, value, overwrite=False)[source]#
Pass through for vector version of function.
- emodpy_malaria.malaria_config.add_species(config, manifest, species_to_select)[source]#
Pass through for vector version of function.
- emodpy_malaria.malaria_config.add_blood_meal_mortality(config, manifest, default_probability_of_death: float = 0.0, species: str = '', allele_combo: list | None = None, probability_of_death_for_allele_combo: float = 0.0)[source]#
Pass through for vector version of function.
- emodpy_malaria.malaria_config.add_insecticide_resistance(config, manifest, insecticide_name: str = '', species: str = '', allele_combo: list | None = None, blocking: float = 1.0, killing: float = 1.0, repelling: float = 1.0, larval_killing: float = 1.0)[source]#
Pass through for vector version of function.
- emodpy_malaria.malaria_config.get_species_params(config, species: str | None = None)[source]#
Pass through for vector version of function.
- emodpy_malaria.malaria_config.set_max_larval_capacity(config, species_name: str, habitat_type: str, max_larval_capacity: int)[source]#
Set the Max_Larval_Capacity for a given species and habitat. Effectively doing something like: simulation.task.config.parameters.Vector_Species_Params[i][“Habitats”][j][“Max_Larval_Capacity”] = max_larval_capacity where i is index of species_name and j is index of habitat_type.
- Parameters:
config – schema-backed config smart dict
species_name – string. Species_Name to target.
habitat_type – enum. Habitat_Type to target.
max_larval_capacity – integer. New value of Max_Larval_Capacity.
- Returns:
Nothing.
- emodpy_malaria.malaria_config.add_microsporidia(config, manifest, species_name: str | None = None, strain_name: str = 'Strain_A', female_to_male_probability: float = 0, female_to_egg_probability: float = 0, male_to_female_probability: float = 0, male_to_egg_probability: float = 0, duration_to_disease_acquisition_modification: dict | None = None, duration_to_disease_transmission_modification: dict | None = None, larval_growth_modifier: float = 1, female_mortality_modifier: float = 1, male_mortality_modifier: float = 1)[source]#
Adds microsporidia parameters to the named species’ parameters.
- Parameters:
config – schema-backed config dictionary, written to config.json
manifest – file that contains path to the schema file
species_name – Species to target, Name parameter
strain_name – Strain_Name The name/identifier of the collection of transmission parameters. Cannot be empty string
female_to_male_probability – Microsporidia_Female_to_Male_Transmission_Probability The probability an infected female will infect an uninfected male.
female_to_egg_probability – Microsporidia_Female_To_Egg_Transmission_Probability The probability an infected female will infect her eggs when laying them.
male_to_female_probability – Microsporidia_Male_To_Female_Transmission_Probability The probability an infected male will infect an uninfected female
male_to_egg_probability – 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.
duration_to_disease_acquisition_modification –
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.
Example:
{ "Times": [ 0, 3, 6, 9 ], "Values": [ 1.0, 1.0, 0.5, 0.0 ] }
duration_to_disease_transmission_modification –
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.
Example:
{ "Times": [ 0, 3, 6, 9 ], "Values": [ 1.0, 1.0, 0.75, 0.5] }
larval_growth_modifier – Microsporidia_Larval_Growth_Modifier A multiplier modifier to the daily, temperature dependent, larval growth progress.
female_mortality_modifier – Microsporidia_Female_Mortality_Modifier A multiplier modifier on the death rate for female vectors due to general life expectancy, age, and dry heat
male_mortality_modifier – Microsporidia_Male_Mortality_Modifier A multiplier modifier on the death rate for male vectors due to general life expectancy, age, and dry heat
- Returns:
Nothing
- emodpy_malaria.malaria_config.configure_linear_spline(manifest, max_larval_capacity: float = 100000000, capacity_distribution_number_of_years: int = 1, capacity_distribution_over_time: dict | None = None)[source]#
Configures and returns a ReadOnlyDict of the LINEAR_SPLINE habitat parameters
- Parameters:
manifest – manifest file containing the schema path
max_larval_capacity – The maximum larval capacity. Sets Max_Larval_Capacity
capacity_distribution_number_of_years – 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
capacity_distribution_over_time –
“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:
{ "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] }
- Returns:
“LINEAR_SPLINE” parameters to be passed directly to “set_species_params” function
- Return type:
Configured Habitat_Type