Skip to contents

Run the full QMRA workflow using custom data for volume and frequency of exposure (not the default databases)

  1. simulate inflow concentration, volume of exposure

  2. calculate initial dose

  3. simulate log reduction for treatment processes

  4. calculate final dose

  5. calculate infection probability, illness probability and dalys reduction

  6. calculate annual total risk

Usage

run_qmra_custom(
  scenario,
  volume,
  frequency,
  concentration,
  objective = 1e-06,
  regulationLog,
  regulationConcentration,
  initialSituation
)

Arguments

scenario

data.frame obtain with create_scenario function

volume

data.frame of min and max value, same size as scenario

frequency

array of integer same size as scenario

concentration

data.frame of pathogenName, min, max and distribution law to simulate

objective

numeric reference dalys threshold to compare simulation result on dalys plot. default value is OMS threshold 1e-6 dalys

regulationLog

data.frame regulation value of the log reduction to compare with simulation result

regulationConcentration

data.frame regulation value of the log reduction to compare with simulation result

initialSituation

boolean, TRUE to consider InitialTrainID for simulation, FALSE to consider SupplementaryTrainID for simulation

Value

all_plots list

Examples

# \donttest{
sc <- create_scenario(system.file("input_1culture_2pop.xlsx", package = "ambre"))

regulation_reduction <- config_ambre$regulation$regulation_value |> 
  dplyr::filter(Country == "France") |>
  dplyr::select(-c(Concentration, Country, RegulationID))
regulation_concentration <- config_ambre$regulation$regulation_value |> 
  dplyr::filter(Country == "France") |>
  dplyr::select(-c(Country, RegulationID, Reduction))

concentration_custom <- data.frame(PathogenName = c("Rotavirus"),
                                   min = c(1),
                                   max = c(2),
                                   type = c("uniform"))
run_qmra_custom(scenario = sc,
                  concentration = concentration_custom,
                  volume = data.frame(min=c(0.5,1), max = c(1,2), type= c("triangle", "triangle")),
                  frequency = c(200L, 300L),
                  regulationLog = regulation_reduction,
                  regulationConcentration = regulation_concentration,
                  initialSituation = TRUE)
#> Simulated pathogen: Rotavirus
#> Create 1000 random distribution(s): uniform (n: 200, min: 1.000000, max: 2.000000)
#> Providing inflow events ... ok. (0.01 secs) 
#> Providing inflow paras ... ok. (0.00 secs) 
#> Simulated pathogen: Rotavirus
#> Create 1000 random distribution(s): uniform (n: 300, min: 1.000000, max: 2.000000)
#> Providing inflow events ... ok. (0.02 secs) 
#> Providing inflow paras ... ok. (0.00 secs) 
#> Simulated exposure: volume per event
#> Create 1000 random distribution(s): triangle (n: 200, min: 0.500000, max: 1.000000, mode = 0.750000)
#> Simulated exposure: volume per event
#> Create 1000 random distribution(s): triangle (n: 300, min: 1.000000, max: 2.000000, mode = 1.500000)
#> Create 1000 random distribution(s): uniform (n: 200, min: 1.000000, max: 2.000000)
#> Create 1000 random distribution(s): uniform (n: 200, min: 1.000000, max: 2.000000)
#> Create 1000 random distribution(s): uniform (n: 200, min: 2.000000, max: 4.000000)
#> Simulated treatment: Q.1 - Activated Sludge for Viruses
#> Simulated treatment: Q.2 - Maturation Pond for Viruses
#> Simulated treatment: Q.6 - Chlorination for Viruses
#> Simulated treatment: Q.1 - Activated Sludge for Viruses
#> Simulated treatment: Q.2 - Maturation Pond for Viruses
#> Simulated treatment: Q.6 - Chlorination for Viruses
#> Joining with `by = join_by(TreatmentID)`
#> Joining with `by = join_by(TreatmentID)`
#> Create 1000 random distribution(s): uniform (n: 300, min: 1.000000, max: 2.000000)
#> Create 1000 random distribution(s): uniform (n: 300, min: 1.000000, max: 2.000000)
#> Create 1000 random distribution(s): uniform (n: 300, min: 2.000000, max: 4.000000)
#> Simulated treatment: Q.1 - Activated Sludge for Viruses
#> Simulated treatment: Q.2 - Maturation Pond for Viruses
#> Simulated treatment: Q.6 - Chlorination for Viruses
#> Simulated treatment: Q.1 - Activated Sludge for Viruses
#> Simulated treatment: Q.2 - Maturation Pond for Viruses
#> Simulated treatment: Q.6 - Chlorination for Viruses
#> Joining with `by = join_by(TreatmentID)`
#> Joining with `by = join_by(TreatmentID)`
#> $logreduction
#> $logreduction$Viruses

#> 
#> 
#> $dalys
#> $dalys$Rotavirus

#> 
#> 
#> $regul_matrix_log
#> 
#> $regul_matrix_concentration
#> 

run_qmra_custom(scenario = sc,
                  concentration = concentration_custom,
                  volume = data.frame(min=c(0.5,1), max = c(1,2), type= c("triangle", "triangle")),
                  frequency = c(200L, 300L),
                  regulationLog = regulation_reduction,
                  regulationConcentration = regulation_concentration,
                  initialSituation = FALSE)
#> Simulated pathogen: Rotavirus
#> Create 1000 random distribution(s): uniform (n: 200, min: 1.000000, max: 2.000000)
#> Providing inflow events ... ok. (0.01 secs) 
#> Providing inflow paras ... ok. (0.00 secs) 
#> Simulated pathogen: Rotavirus
#> Create 1000 random distribution(s): uniform (n: 300, min: 1.000000, max: 2.000000)
#> Providing inflow events ... ok. (0.02 secs) 
#> Providing inflow paras ... ok. (0.00 secs) 
#> Simulated exposure: volume per event
#> Create 1000 random distribution(s): triangle (n: 200, min: 0.500000, max: 1.000000, mode = 0.750000)
#> Simulated exposure: volume per event
#> Create 1000 random distribution(s): triangle (n: 300, min: 1.000000, max: 2.000000, mode = 1.500000)
#> Create 1000 random distribution(s): uniform (n: 200, min: 1.000000, max: 2.000000)
#> Create 1000 random distribution(s): uniform (n: 200, min: 1.000000, max: 2.000000)
#> Create 1000 random distribution(s): uniform (n: 200, min: 2.000000, max: 4.000000)
#> Create 1000 random distribution(s): uniform (n: 200, min: 1.000000, max: 1.000000)
#> Simulated treatment: Q.1 - Activated Sludge for Viruses
#> Simulated treatment: Q.2 - Maturation Pond for Viruses
#> Simulated treatment: Q.6 - Chlorination for Viruses
#> Simulated treatment: E.1.1 - Micro-sprinkler for Viruses
#> Simulated treatment: Q.1 - Activated Sludge for Viruses
#> Simulated treatment: Q.2 - Maturation Pond for Viruses
#> Simulated treatment: Q.6 - Chlorination for Viruses
#> Simulated treatment: E.1.1 - Micro-sprinkler for Viruses
#> Joining with `by = join_by(TreatmentID)`
#> Joining with `by = join_by(TreatmentID)`
#> Create 1000 random distribution(s): uniform (n: 300, min: 1.000000, max: 2.000000)
#> Create 1000 random distribution(s): uniform (n: 300, min: 1.000000, max: 2.000000)
#> Create 1000 random distribution(s): uniform (n: 300, min: 2.000000, max: 4.000000)
#> Create 1000 random distribution(s): uniform (n: 300, min: 1.500000, max: 3.000000)
#> Simulated treatment: Q.1 - Activated Sludge for Viruses
#> Simulated treatment: Q.2 - Maturation Pond for Viruses
#> Simulated treatment: Q.6 - Chlorination for Viruses
#> Simulated treatment: P.5 - Natural die-off for Viruses
#> Simulated treatment: Q.1 - Activated Sludge for Viruses
#> Simulated treatment: Q.2 - Maturation Pond for Viruses
#> Simulated treatment: Q.6 - Chlorination for Viruses
#> Simulated treatment: P.5 - Natural die-off for Viruses
#> Joining with `by = join_by(TreatmentID)`
#> Joining with `by = join_by(TreatmentID)`
#> $logreduction
#> $logreduction$Viruses

#> 
#> 
#> $dalys
#> $dalys$Rotavirus

#> 
#> 
#> $regul_matrix_log
#> 
#> $regul_matrix_concentration
#> 
# }