Changelog
Source:NEWS.md
AnophelesModel 2.0.0
Version 2 is a refactoring of AnophelesModel version 1 (last release v1.1.0), developed as AnophelesModel2. It keeps the entomological model of the mosquito feeding cycle (Chitnis et al.) and the host / activity databases, but the intervention framework and API were rewritten and are not backward compatible.
Host-seeking killing names
- Host-seeking killing is named
KillingDuringHostSeekingAbsolute(efficacy component) andkilling_during_host_seeking_absolute(batch column), formerlyHostSeekingKilling/host_seeking_killing, so that it is clear it is the absolute rate (consistent with AnophelesEntoTrials). The relative value of the hut trial fits isKillingDuringHostSeekingRelativeinITN_parameterisations_Champagne2025(formerlyKillingDuringHostSeeking);get_ITN_params(rescale_hsk = FALSE)returns it under that name. Former and relative names give an error naming the absolute one (a former batch column would otherwise have run the standard model). The decay suffix_hsk(halflife_hsk, OpenMalaria placeholders) is unchanged.
Correctness and input validation
- Explicit per-component insecticide decay shapes always take priority over linear half-lives. Constant shapes need no decay parameters; incomplete non-constant specifications and zero or NaN linear half-lives now raise errors identifying the component and parameter-set row.
- Intervention interfaces reject unnamed, duplicate, missing or invalid efficacies, out-of-range coverages (including uncertainty draws), and non-positive or non-finite durations. Positive subday durations use one time point consistently. Host-seeking killing remains a non-negative rate that can exceed one; optional batch
NAvalues still mean inactive. -
def_host_params()orders custom host tables as human then animal, so reversing input rows no longer changes host parameters or model results. Thespecies_namecolumn of custom host tables is optional (host parameters are species-independent). - Incubation-survival sums now include the term at index zero when it is their only term. This corrects custom parameterisations with longer resting durations or shorter incubation periods; bundled parameterisations retain their existing results.
-
calculate_combined_impact()handles complete deterrency and killing without dividing by zero when no mosquitoes reach a feeding stage. - Impact calculations now raise an error for a zero baseline vectorial capacity (relative reduction is undefined) or non-finite results, instead of silently reporting zero impact. The message names the time point and the parameter sets concerned (and the draw in
run_interventions(), or the intervention incalculate_impact()). -
get_ITN_params(mode = "dummy_host"): the insecticide decay of the rescaled host-seeking killing uses the trial’s own aging time (newaged_timecolumn ofITN_parameterisations_Champagne2025: 3 years, 2 for Sovegnon); it was always 3 years, so Sovegnon’s host-seeking killing decayed 1.5 times too slowly.get_ITN_params()also documentsmodein its result. -
calculate_combined_impact()rebuilds both interventions’ daily effects from their parameters ($param_set, duration,insecticide_decay) with the suppliedmodel_p, ascalculate_impact(): results no longer depend on the model used to build the interventions. It accepts overlaps exactly at their bounds (e.g. coverages 0.8 and 0.8 with overlap 0.6), which floating-point arithmetic rejected. - One-day (and shorter) batches with several parameter sets: the attrition matrix keeps one row per parameter set (it was transposed, giving an error).
- More inputs that were silently accepted are errors (fail loudly):
component_decayelements withoutdecayor with unknown fields;L_*/kappa_*batch columns withoutdecay_*; a missingdecay_attritioncolumn, and attrition columns are matched exactly (the oldL/kappa/decaycolumn names, and$partial matching, could pick up another column); vector values of single arguments ofbuild_intervention(); an invalidinsecticide_decay; uncertainty draws mixing the standard and dummy-host models; custom vector tables without the model’s columns (M,Chi,A0,zeta.3,td,tau,ts; a missingtaubecame 1 day) or out of range; an extrinsic incubation period shorter than the resting duration (was raised to it), or not a whole number of days (the survival sums need whole days, and the OpenMalaria export rounded it); unknown activity pattern IDs. Attrition errors name the parameter-set row; the Weibull fit warns when it stops at the iteration limit. - Misspelled component names in
halflife_insecticide/component_decay(e.g.Preprandial), and misspelled decay columns ofrun_interventions()batch tables (e.g.halflife_pree), are errors: they were silently ignored, leaving the effect without its decay. - Activity patterns combined with
c()(instead oflist(), one per taxon) are an error inget_OM_ento_snippet()andcalculate_exposure(): their duplicated entries silently gave every taxon the first pattern.
Vector bionomics from AnophelesBionomics
-
vec_ent_paramnow comes from AnophelesBionomics (posterior means and sds of its hierarchical Bayesian model), replacing the older parameterisation. Results differ from version 1. - Taxa have an explicit
level(species,complex,genus), a parentcomplexandimputed_traits(parameters without data of their own).def_vector_params()gainslevel;list_all_species()returns a data frame of taxa. -
An. gambiae s.s. and An. coluzzii are merged as
"Anopheles gambiae ss/coluzzii", the new default species; the old names are accepted with a warning. Complexes are named by their label (e.g."Gambiae"). -
tau(resting duration) is estimated per taxon from the fed / gravid ratio (1.07 days for An. gambiae ss/coluzzii, about 2 days for the genus) instead of the fixed value 3. In the survival over the extrinsic incubation period it is rounded to whole days (at least one); the former silent replacement oftau < 2by 2 is removed. -
Chiis the indoor human blood index by default; indoor and outdoor HBI are both stored anddef_vector_params(hbi = "outdoor" | "weighted")selects another one. -
read_bionomics_table()anddef_vector_params(bionomics_table = )use a newer bionomics table without reinstalling. The dataset is regenerated with the scripts indata-raw/.
Export to OpenMalaria
- New demo of the export:
demo("OM_export", package = "AnophelesModel")(mosquito populations with species-specific activity patterns, ITNs, XML text, scenario values; its last part needs openMalariaUtilities). -
get_OM_ento_snippet()is rewritten: it returns the input lists ofopenMalariaUtilities::defineEntomology()(no XML nodes; the XML dependency is removed). It fixes the mapping of the original version, which wrote the resting durationtauasmosqSeekingDurationand hardcodedmosqRestDuration = 2: nowmosqRestDuration=tauin whole days andmosqSeekingDuration=td. With activity patterns, each species is split into_indoor1/_indoor2/_outdoorpopulations by human exposure, with indoor / outdoor human blood indices. - New
get_OM_GVI_snippet(): generic vector intervention foropenMalariaUtilities::defineVectorControl(), one component per effect with its own decay (exact when possible, fitted Weibull for attrition x insecticide decay), acting on populations exposed in bed (ITN) or resting indoors (IRS). For dummy-host interventions it has deterrency and post-prandial killing only (no pre-prandial killing). - New
define_OM_vector_control()/deploy_OM_vector_control(): write a whole ITN / IRS intervention into an openMalariaUtilitiesbaseList, with one<deployment>holding all its components (same people) and one deploy per campaign of aschedule(dates, numeric or placeholder coverages). The define writes the components, the deploy the deployment (the schedule is given only there). Defines and deploys can come in any order: components are always written before the deployments, as OpenMalaria requires (also withadd_OM_GVI()). Host-seeking killing of dummy-host nets is exported as the model’s dummy host: per campaign, an OpenMalaria added non-human host (addNonHumanHosts, availability relative to an adult human = coverage ×KillingDuringHostSeekingAbsolute/ human availability, biting probability 0) whose availability decays as the GVI effects do: attrition × insecticide decay of host-seeking killing, exact when it is a single OpenMalaria decay, otherwise the Weibull fitted to the product (onenonHumanHostsModificationsper host,<name>_dummy_<k>_decay, with an increasing decay; placeholders@<name>_hsk_L@/_k@like the other effects). Written by the deploy (once, with the whole schedule); it needs OpenMalaria schema >= 46 (checked with 49), from thebaseList’sOMVersion. OpenMalaria scales an added host by the availability of an average adult (the hut sleeper), so relative to the average human the host-seeking killing is stronger than in the package’s model (by the adult / mean availability ratio, 1.35 in the scenario checked); this choice may be revisited. A named list of interventions defines one intervention whose values are chosen per scenario, e.g. to loop scenarios over net types. - Age-restricted deployments need both
minAgeandmaxAge(or neither, all ages); a single limit, negative ages orminAge >= maxAgeare errors. - Checked in OpenMalaria, through openMalariaUtilities, on the entomological outputs: standard ITNs deployed by campaigns (OpenMalaria 44 and 49); dummy-host nets, a named list of nets with placeholder decays, IRS (both
irs_exposuredefinitions), age-restricted, cumulative and continuous deployments (OpenMalaria 49). For dummy-host nets, timing, coverage, replacement by later campaigns, populations reached and lifespan are as designed, and the decay of the added hosts follows the written decay within 0.3% of the initial effect. The plain-text route writes the same XML as the openMalariaUtilities route. Not run in OpenMalaria: sub-population deployments (subpop). -
om_scenario_values(): decay columns with fixed decays are an error even when nothing else needs filling; attrition columns on a net without attrition, and akappacolumn on a shape-less attrition, are errors (they had no effect); factor columns are read as values; an undeployed dummy-host intervention is always an error. -
get_OM_GVI_snippet()warns that host-seeking killing of dummy-host interventions is not in the GVI (nor written byadd_OM_GVI()). - Without the indoor/outdoor split (
get_OM_ento_snippet()withoutactivity), the GVI export warns that the intervention acts on all the bites, outdoor ones included (get_OM_GVI_snippet(),define_OM_vector_control(),get_OM_xml()). - Populations with a share of 0 (e.g.
indoor2when the in-bed and IRS shares are equal, or a species with aspecies_sharesof 0) are not written (theirannualEIRwould be 0);om_ento_values()warns when a composition gives a species a share of 0. - Placeholder names that would collide are errors: two populations, or two interventions of a
baseList, whose names give the same cleaned placeholder (e.g."IG 2"and"IG_2"). - All schedule dates (
om_campaigns(), schedules,end_date,om_continuous()) must be"YYYY-MM-DD"(orDateobjects); formats such as"2021/01/01"were accepted by campaigns only. - The Weibull fitted to attrition × insecticide decay (
fitted_decay, used by the OpenMalaria export) no longer has an amplitude: it starts at 1, as the curve written to OpenMalaria, so the fit is the curve that is used (an amplitude was fitted, then ignored).fitted_decayhas columnscomponent,L,kappa,rmse. - The warnings on unusual attrition (IRS with attrition, ITN without) are given on every export route (also
define_OM_vector_control()/get_OM_xml()with placeholder decays or a list of nets), not only for a single net with fixed decays. - The OpenMalaria export writes the
Lof decays ending atL(step, linear, smooth-compact) rounded towards zero, with 10 digits: rounding up kept the protection beyond its end (a 45-day step ended after day 45). - IRS can reach the mosquitoes resting indoors (endophily, default) or those biting indoors:
get_OM_ento_snippet(irs_exposure = "indoor_resting" | "indoor_biting")sets the population split of the OpenMalaria export accordingly; in the vectorial capacity calculation, the same choice is theexposurepassed (indoor_restingorExposure_Indoor_total). Documented in the vignette. - Dummy hosts in OpenMalaria: each campaign replaces the nets of its recipients, as the GVI does (a component redeployed to a person is refreshed, not stacked): earlier dummy hosts are reduced by the coverage of every later campaign (
<name>_dummy_<j>_replaced_<k>, constant availability reduction = the campaign’s coverage or its placeholder). Before, cohorts accumulated (two campaigns at 100% gave twice the host-seeking killing while the GVI stayed at one net). -
om_scenario_values(): half-life and shape columns are independent overrides (akappacolumn alone changes the shape and keeps the half-life); withcombine = FALSE, the net’s own decay parameters are kept for what is not supplied. Values are validated (positive, shape where needed), errors naming rows and effect. -
define_OM_entomology()writes the animal host parameters ofom_ento(hosts_p) instead of openMalariaUtilities’ fixed values, so both routes write the same entomology. - New
om_continuous(): continuous deployment at target ages (e.g. EPI, school), with coverage and optional begin / end, accepted asschedulebydeploy_OM_vector_control()andget_OM_xml()(standard model; same structure as openMalariaUtilities’deploy_cont_compat()). - Schema version: 44 by default;
get_OM_xml(schema = )or thebaseList’sOMVersion. From 49, the entomology has nopropInfected/propInfectious(removed in 49; also dropped bydefine_OM_entomology()). Standard interventions are the same in 44 and 49. - Placeholders only where something varies: efficacies with several nets, decays with
define_OM_vector_control(decay = "placeholder")(otherwise written from the nets), dummy-host availabilities unless the net and the coverages are fixed. - New
om_scenario_values(): fills these placeholders in the user’s own scenario table, row by row (net from a column, coverages from the columns named like the schedule’s placeholders), from thebaseListor theget_OM_xml()result, which keep what was written. Decays: by default one attrition column (years, ordecay_unit = "days") combined with each effect’s insecticide decay (the dummy hosts take the attrition as it is);combine = FALSEfor final decays per effect. Computed once per distinct net and decay. - New
om_vector_control(): specifies an intervention for the OpenMalaria export from its efficacies (or aget_ITN_params()parameterisation) and decays, without a model or a duration; the export builds it with the entomology of the scenario and fits Weibull decays over 3 years (ITN) or 1 year (IRS) by default (fit_years). Intervention objects ofbuild_intervention()remain accepted. - New
om_campaigns(): campaign schedules from regular dates (from,to,every, asseq.Date()) or given dates, with one coverage (number or placeholder), one per campaign, or one placeholder per year (by_year = TRUE, asbyyearofdeploy_it_compat()), and optionally theend_dateof the period (life of the dummy hosts), kept with the schedule so that deploy andget_OM_xml()need noend_dateargument. - In a list of interventions (template), each effect keeps its decay function when all the interventions share it (e.g. a step for historical nets), with its parameters as placeholders; it is a Weibull only when the decay functions differ.
- New
define_OM_entomology(): writes the entomology withdefineEntomology()(seasonality as numbers or placeholders, by default@m1@…@m12@, which need a recent openMalariaUtilities;scaledAnnualEIR) and keeps it in thebaseList;define_OM_vector_control()takes the mosquito populations and parameters from there (noom_entoargument), so the interventions are consistent with the entomology. -
get_OM_ento_snippet()also returnsmuvA(inshares) and the model of each mosquito population (model_params, whose human availability scales the dummy hosts). - The OpenMalaria export follows the model’s priorities for insecticide decay: an explicit shape, then a linear half-life (
NA: unspecified). - Relative contribution of the species to the EIR: each population’s
annualEIRis its relative contribution (species share × share within the species), the total EIR being set withscaledAnnualEIRon<entomology>.eir_shares()computes species shares from relative abundances and sporozoite rates;get_OM_ento_snippet(species_shares = )writes the contributions as numbers, and without it as placeholders@contrib_<population>@, filled byom_ento_values()for one or several species compositions. Shares that do not sum to 1, or do not match the taxa, are errors. - New
get_OM_xml(): the entomology and vector control as XML text, without openMalariaUtilities, to paste into an existing scenario: one snippet for the entomology (<vector>, same structure asdefineEntomology()but with the animal host parameters ofhosts_p), and per intervention one for the components (define), one for the deployment (deploy) and, for dummy-host interventions, the dummy hosts and their decays. It shares the list builders ofdefine_OM_vector_control()/deploy_OM_vector_control(), so both routes write the same XML. - New
add_OM_GVI(): writes these interventions into an openMalariaUtilitiesbaseList, as a single component when the three decays are identical and one component per effect otherwise (openMalariaUtilities in Suggests). -
build_intervention()keeps its inputs in$settings(used by the export).
New
-
build_intervention()builds an intervention from user-supplied efficacies (Deterrency,PrePrandial,PostPrandial,KillingDuringHostSeekingAbsolute), an attrition decay and optional per-component insecticide decay. -
run_interventions()evaluates many parameter sets × coverages in one vectorised call, with zipped uncertainty draws (vec_param_sets,interv_param_sets,exposure_sets,coverage_sets). -
get_ITN_params()/list_ITN_params()load ITN efficacies and insecticide decay fitted to experimental hut trials (ITN_parameterisations_Champagne2025). The dataset has afitcolumn: a trial fitted in several parts (Sovegnon) has one control per fit, and host-seeking killing is rescaled by the control of the net’s own fit. -
get_IRS_params()/list_IRS_params()load IRS efficacies at spraying and their Weibull decays (half-life in days, shape >= 1) fitted to experimental hut trials (IRS_parameterisations, currently Tchicaya et al. 2014), forbuild_intervention(component_decay = , decay_attrition = "none")orom_vector_control(), in both model structures (host-seeking killing rescaled by the controlalpha_0). The decay of pre-prandial killing, not fitted, is derived from the hut model.om_vector_control()also takes thecomponent_decayof such a list. -
Dummy-host model: host-seeking killing (
KillingDuringHostSeekingAbsolute) adds a fourth host type whose availability is the absolute killing rate (in the units of the host availabilities, not a probability). It is mutually exclusive with pre-prandial killing.get_ITN_params(mode = "dummy_host")converts the hut-trial estimates, which are relative to the control-arm availabilityalpha_0, to absolute values by multiplying byalpha_0of the same arm (rescale_hsk = FALSEreturns the relative value). The hut model’s rates are per hut-night while the package uses per-day rates; by provisional convention a hut-night is treated as a day (no conversion by the host-seeking durationtd), pending an improved experimental hut fitting model. -
Insecticide decay: per-component linear decay (
halflife_insecticide, years, a time-to-zero calibrated so that efficacy at the washed arm’s aging time, 3 years or 2 for Sovegnon, equals the 20x-washed value) or any decay shape (component_decay). Theinsecticide_decay = FALSEswitch keeps unwashed efficacies throughout. WithTRUE,build_intervention()also returnsfitted_decay, one Weibull per component approximating attrition × insecticide decay. -
decay_function()supportsweibull,exponential,hill,linear,step,smooth-compactandnone/constant, following OpenMalaria conventions (Lis a half-life for weibull/exponential/hill and a time to zero for linear/step/smooth-compact); values always stay in [0, 1]. -
calculate_combined_impact()supports dummy-host interventions (host-seeking killing is additive for people covered by both products).
Changed
-
build_model_obj(vec_p, hosts_p)no longer takes activity patterns ortotal_pop;Nv0is no longer an argument anywhere. Host populations are unit-sized and vectorial capacity reduction is scale-invariant. -
Exposure acts on coverage, not on efficacies. Version 1 adjusted the intervention effects by indoor/in-bed exposure (
adjustment_for_location). Nowcalculate_exposure()(formerlyget_in_out_exp(), same calculation) gives an exposure factor passed asexposuretocalculate_impact()/run_interventions(), which use the effective coveragecoverage × exposure. -
calculate_impact()always computes impact relative to coverage 0, even ifcoverage_vecdoes not start with 0 (previously relative to its first element).calculate_impact(),run_interventions()andcalculate_combined_impact()share one vectorised engine. -
calculate_impact()isrun_interventions()applied to the parameters stored in each intervention ($param_set, added bybuild_intervention()) and returns the samedata.table(one row per intervention and coverage, withintervention,name, the parameters,coverage,exposure,avg_vc,avg_impact) instead of the nested list of version 1. The model parameters all come frommodel_p. Interventions are combined withc(); objects not made bybuild_intervention()are rejected. -
keep_time = TRUEincalculate_impact()andrun_interventions()also returns the vectorial capacity and impact on each day, for all parameter sets. -
plot_impact()replacesplot_impact_species()andplot_impact_var(): it plots the output of both functions, with the median and 95% interval when there are uncertainty draws. ggpubr and Hmisc are no longer suggested. -
calculate_combined_impact()evaluates both interventions over the shorter duration (one point per day) and reports the assigned coverages viamessage().
Removed
- Intervention database and its functions:
def_interventions_effects(),get_net_types(),get_net_insecticides(),get_net_decay(),list_available_interventions(),list_intervention_models(), and the datasetsinterventions_paramandintervention_obj_examples. Usebuild_intervention()/get_ITN_params()instead. -
AnophelesModel(),calculate_impact_var(),calculate_impact_ip(),calculate_combined_impact_var(); userun_interventions()for variability and uncertainty. -
get_exposure_multiplier()(exposure now acts on coverage, see above). - The XML-node outputs of
get_OM_ento_snippet()/get_OM_GVI_snippet()(see “Export to OpenMalaria” above for their replacements).