Package: MGDrivE2 2.1.1

Sean L. Wu

MGDrivE2: Mosquito Gene Drive Explorer 2

A simulation modeling framework which significantly extends capabilities from the 'MGDrivE' simulation package via a new mathematical and computational framework based on stochastic Petri nets. For more information about 'MGDrivE', see our publication: Sánchez et al. (2019) <doi:10.1111/2041-210X.13318> Some of the notable capabilities of 'MGDrivE2' include: incorporation of human populations, epidemiological dynamics, time-varying parameters, and a continuous-time simulation framework with various sampling algorithms for both deterministic and stochastic interpretations. 'MGDrivE2' relies on the genetic inheritance structures provided in package 'MGDrivE', so we suggest installing that package initially.

Authors:Sean L. Wu [aut, cre], Jared B. Bennett [aut], Héctor Manuel Sánchez Castellanos [ctb], Tomás M. León [ctb], Andrew J. Dolgert [ctb], John M. Marshall [aut], Agastya Mondal [aut]

MGDrivE2_2.1.1.tar.gz
MGDrivE2_2.1.1.zip(r-4.7)MGDrivE2_2.1.1.zip(r-4.6)MGDrivE2_2.1.1.zip(r-4.5)
MGDrivE2_2.1.1.tgz(r-4.6-any)MGDrivE2_2.1.1.tgz(r-4.5-any)
MGDrivE2_2.1.1.tar.gz(r-4.7-any)MGDrivE2_2.1.1.tar.gz(r-4.6-any)
MGDrivE2_2.1.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
MGDrivE2/json (API)

# Install 'MGDrivE2' in R:
install.packages('MGDrivE2', repos = c('https://marshalllab.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/marshalllab/mgdrive/issues

Datasets:
  • mu_ts - Mosquito Death Rates, Comoros Islands

On CRAN:

Conda:

7.19 score 8 stars 48 scripts 513 downloads 1 mentions 62 exports 4 dependencies

Last updated from:f7ec820e8a. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK145
source / vignettesOK343
linux-release-x86_64OK134
macos-release-arm64OK131
macos-oldrel-arm64OK104
windows-develOK187
windows-releaseOK107
windows-oldrelOK99
wasm-releaseOK105

Exports:add_interventionsbatch_migrationcalc_move_rateconvert_prevalence_to_eirequilibrium_Imperial_decoupledequilibrium_lifeycleequilibrium_SEI_decoupled_humanequilibrium_SEI_decoupled_mosyequilibrium_SEI_Imperialequilibrium_SEI_SEIRequilibrium_SEI_SISget_shapehuman_Imperial_ODEimperial_model_param_list_createmake_Q_Imperialmake_Q_SEImovement_prob2ratesim_trajectory_CSVsim_trajectory_CSV_decoupledsim_trajectory_Rsim_trajectory_R_decoupledsolve_muAquasplit_aggregate_CSVsplit_aggregate_CSV_decoupledspn_hazardsspn_hazards_decoupledspn_P_epi_decoupled_nodespn_P_epiSEIR_networkspn_P_epiSEIR_nodespn_P_epiSIS_networkspn_P_epiSIS_nodespn_P_lifecycle_networkspn_P_lifecycle_nodespn_Sspn_T_epi_decoupled_nodespn_T_epiSEIR_networkspn_T_epiSEIR_nodespn_T_epiSIS_networkspn_T_epiSIS_nodespn_T_lifecycle_networkspn_T_lifecycle_nodestep_CLEstep_DMstep_ODEstep_ODE_decoupledstep_PTSstep_PTS_decoupledsummarize_eggs_genosummarize_eggs_stagesummarize_femalessummarize_females_episummarize_humans_epiImperialsummarize_humans_epiSEIRsummarize_humans_epiSISsummarize_larvae_genosummarize_larvae_stagesummarize_malessummarize_pupae_genosummarize_pupae_stagesummarize_stats_CSVsummarize_stats_CSV_decoupledtrack_hinf

Dependencies:deSolvelatticeMatrixstatmod

MGDrivE2: Advanced Topics
Table of Contents | Preface | Custom Numerical Routines | Step Function | Test Simulation | Parameterization | Initialization of the Petri Net | Equilibrium Conditions and Hazard Functions | Simulation of Fully Specified SPN Model | Euler Method Solutions | Default ODE Solutions | Analysis | Tips and Tricks

Last update: 2025-09-14
Started: 2020-10-06

MGDrivE2: Metapopulation Network Epidemiological Dynamics
Table of Contents | Preface | Parameterization | Initialization of the Petri Net | Equilibrium Conditions and Hazard Functions | Simulation of Fully Specified SPN Model | Deterministic: ODE Solutions | Stochastic: Tau-leaping Solutions | References

Last update: 2025-09-14
Started: 2020-10-06

MGDrivE2: One Node Epidemiological Dynamics
Table of Contents | Preface | Parameterization | Initialization of the Petri Net | Equilibrium Conditions and Hazard Functions | Simulation of Fully Specified SPN Model | Deterministic: ODE Solutions | Stochastic: Chemical Langevin Equation Solutions | References

Last update: 2025-09-14
Started: 2020-10-06

MGDrivE2: One Node Epidemiological Dynamics - Decoupled SIS Sampling
Table of Contents | Preface | Parameterization | Initialization of the Petri Net | Equilibrium Conditions and Hazard Functions | Simulation of Fully Specified SPN Model | Stochastic: Tau Leaping Solutions | References

Last update: 2025-09-14
Started: 2025-09-14

MGDrivE2: One Node Epidemiological Dynamics - Decoupled Imperial Sampling
Table of Contents | Preface | Parameterization | Initialization of the Petri Net | Equilibrium Conditions and Hazard Functions | Simulation of Fully Specified SPN Model | Deterministic: Decoupled ODE model | Stochastic: Tau Leaping Solutions

Last update: 2025-09-14
Started: 2025-09-14

MGDrivE2: Simulation of Time-inhomogeneous Stochastic Processes (Seasonality)
Table of Contents | Preface | Time-Inhomogeneous Adult Mortality | Time-dependent Rate Functions | Mathematical Considerations | Programming Time-Dependent Rates in MGDrivE2 | Petri Net Setup | Parameterization | Initialization of the Petri Net | Equilibrium Conditions and Hazard Functions | Simulation of Fully Specified SPN Model | Simulation: ODE Models | Simulation: CTMC Models | Results | References

Last update: 2025-09-14
Started: 2020-10-06

MGDrivE2: Metapopulation Network Lifecycle Dynamics
Table of Contents | Preface | Parameterization | Initialization of the Petri Net | Equilibrium Conditions and Hazard Functions | Simulation of Fully Specified SPN Model | Deterministic: ODE Solutions | Stochastic: Tau-leaping Solutions

Last update: 2025-09-14
Started: 2020-10-06

MGDrivE2: One Node Lifecycle Dynamics
Table of Contents | Preface | Example: Logistic Density Dependence | Parameterization | Initialization of the Petri Net | Equilibrium Conditions and Hazard Functions | Simulation of Fully Specified SPN Model | Deterministic: ODE Solutions | Stochastic: Tau-leaping Solutions | Example: Lotka-Volterra Density Dependence | Equilibrium Conditions and Hazard Functions | Simulation of Fully Specified SPN Model | Deterministic: ODE Solutions | Stochastic: CLE Solutions

Last update: 2025-09-14
Started: 2020-10-06

MGDrivE2: SEIR Epidemiological Dynamics
Table of Contents | Preface | One Node Simulations | Parameterization | Initialization of the Petri Net | Equilibrium Conditions and Hazard Functions | Simulation of Fully Specified SPN Model | Deterministic: ODE Solutions | Stochastic: Tau-leaping Solutions | Metapopulation Network Simulations | Parameterization | Initialization of the Petri Net | Equilibrium Conditions and Hazard Functions | Simulation of Fully Specified SPN Model | Deterministic: ODE Solutions | Stochastic: CLE Solutions | References

Last update: 2025-09-14
Started: 2020-10-06

Readme and manuals

Help Manual

Help pageTopics
This set of functions modifies mosquito life history parameters in the presence of adult interventions - indoor residual spraying (IRS) and insecticide treated nets (ITN) This is based on the work of Le Menach et al (2007) and Griffin et al (2010). We vary three parameters in the presence of interventions: Egg laying rate (beta) Adult mortality (muF) Mosquito biting rate (av0)add_interventions
Sample Batch Migration Eventsbatch_migration
Calculate Outbound Movement Ratecalc_move_rate
Generally, pathogen prevalence is a more accesible metric for users, but the Imperial equilibrium function requires an annual EIR. This function converts a given pathogen prevalence to an EIRconvert_prevalence_to_eir
This function calculates the human and mosquito equilibrium values for the decoupled Imperial model. Currently this only works in one node.equilibrium_Imperial_decoupled
This function calculates the human equilibrium values for the decoupled Imperial model. Requires the age structure of the population Currently this only works in one node.equilibrium_Imperial_decoupled_human
Calculate Equilibrium for Lifecycle Model (Logistic or Lotka-Volterra)equilibrium_lifeycle
This function calculates the equilibrium values for the decoupled SIS human states. Currently this only works in one node.equilibrium_SEI_decoupled_human
Calculate Equilibrium for Decoupled Mosquito SEI model. Human states will be handled separately.equilibrium_SEI_decoupled_mosy
Calculate Equilibrium for Mosquito SEI - Human Imperial Modelequilibrium_SEI_Imperial
Calculate Equilibrium for Mosquito SEI - Human SEIR Modelequilibrium_SEI_SEIR
Calculate Equilibrium for Mosquito SEI - Human SIS Modelequilibrium_SEI_SIS
Calculate Erlang shape parameterget_shape
ODE describing the age-structured Imperial model used in decoupled sampling, which will pass in values of I_V and return the human states for usein the mosquito portion of the modelhuman_Imperial_ODE
Model Parameter List Creationimperial_model_param_list_create
Rate Matrix (Q) for Adult Mosquito SEI Dynamicsmake_Q_Imperial
Rate Matrix (Q) for Adult Mosquito SEI Dynamicsmake_Q_SEI
Convert Stochastic Matrix to Rate Matrixmovement_prob2rate
Mosquito Death Rates, Comoros Islandsmu_ts
Simulate Trajectory From one SPN Modelsim_trajectory_base_CSV
Simulate Trajectory From one SPN Modelsim_trajectory_base_CSV_decoupled
Simulate Trajectory From one SPN Modelsim_trajectory_base_R
Simulate Trajectory From one SPN Model using Imperial Malaria modelsim_trajectory_base_R_decoupled_Imperial
Simulate Trajectory From one SPN Model using Human SIS modelsim_trajectory_base_R_decoupled_SIS
Simulate Trajectory From a SPN Modelsim_trajectory_CSV
Simulate Trajectory From a SPN Modelsim_trajectory_CSV_decoupled
Simulate Trajectory From a SPN Modelsim_trajectory_R
Simulate Trajectory From a SPN Modelsim_trajectory_R_decoupled
Solve for Constant Aquatic Mortalitysolve_muAqua
Split CSV output by Patch and Aggregate by Mate or Dwell-Stagesplit_aggregate_CSV
Split CSV output for decoupled sampling with Imperial malaria modelsplit_aggregate_CSV_decoupled
Make Hazards (Lambda) For a MGDrivE2: Node and Network Simulationsspn_hazards
Make Hazards (Lambda) For a MGDrivE2: Node and Network Simulationsspn_hazards_decoupled
Make Places (P) For a Node (SEI Mosquitoes). Note in the v2 epi module, we only use the SPN framework for the mosquito component of the model. The human compoenent will be handled separately in the sampler, and will be formulated as an ODE. This function makes the set of places (P) for a SPN. It is used alone if our model is a single-node metapopulation for mosquito SEI and dynamics; This is used by both SIS and Imperial transmission models.spn_P_epi_decoupled_node
Make Places (P) For a Network (SEI Mosquitoes - SEIR Humans)spn_P_epiSEIR_network
Make Places (P) For a Node (SEI Mosquitoes - SEIR Humans)spn_P_epiSEIR_node
Make Places (P) For a Network (SEI Mosquitoes - SIS Humans)spn_P_epiSIS_network
Make Places (P) For a Node (SEI Mosquitoes - SIS Humans)spn_P_epiSIS_node
Make Places (P) For a Network (Mosquitoes only)spn_P_lifecycle_network
Make Places (P) For a Node (Mosquitoes only)spn_P_lifecycle_node
Make Post Matrix For a Petri Netspn_Post
Make Pre Matrix For a Petri Netspn_Pre
Make stoichiometry Matrix For a Petri Netspn_S
Make Transitions (T) For a Node (SEI Mosquitoes)spn_T_epi_decoupled_node
Make Transitions (T) For a Network (SEI Mosquitoes - SEIR Humans)spn_T_epiSEIR_network
Make Transitions (T) For a Node (SEI Mosquitoes - SEIR Humans)spn_T_epiSEIR_node
Make Transitions (T) For a Network (SEI Mosquitoes - SIS Humans)spn_T_epiSIS_network
Make Transitions (T) For a Node (SEI Mosquitoes - SIS Humans)spn_T_epiSIS_node
Make Transitions (T) For a Network (Mosquitoes only)spn_T_lifecycle_network
Make Transitions (T) For a Node (Mosquitoes only)spn_T_lifecycle_node
Make Chemical Langevin (CLE) Sampler for a SPN modelstep_CLE
Make Gillespie's Direct Method (DM) Sampler for a SPN modelstep_DM
Make Mean-field Approximation (ODE) Numerical Integrator for a SPN Modelstep_ODE
Make Mean-field Approximation (ODE) Numerical Integrator for a SPN Model for Decoupled Epi Dynamicsstep_ODE_decoupled
Make Poisson Time-Step (PTS) Sampler for a SPN Modelstep_PTS
Make Poisson Time-Step (PTS) Sampler for a SPN Modelstep_PTS_decoupled
Summarize Eggs by Genotypesummarize_eggs_geno
Summarize Eggs by Erlang-Stagesummarize_eggs_stage
Summarize Adult Females (One Node or Metapopulation Network, Lifecycle Model)summarize_females
Summarize Adult Females (One Node or Metapopulation Network, SEI Mosquitoes)summarize_females_epi
Summarize Humans for Imperial Modelsummarize_humans_epiImperial
Summarize Humans (One Node or Metapopulation Network, SEI Mosquitoes - SEIR Humans)summarize_humans_epiSEIR
Summarize Humans (One Node or Metapopulation Network, SEI Mosquitoes - SIS Humans)summarize_humans_epiSIS
Summarize Larvae by Genotypesummarize_larvae_geno
Summarize Larval by Erlang-Stagesummarize_larvae_stage
Summarize Adult Males (One Node or Metapopulation Network)summarize_males
Summarize Pupal by Genotypesummarize_pupae_geno
Summarize Pupal by Erlang-Stagesummarize_pupae_stage
Summary Statistics for MGDrivE2summarize_stats_CSV
Summary Statistics for MGDrivE2 - Decoupled samplessummarize_stats_CSV_decoupled
Make tracking matrix for human infection eventstrack_hinf