Skip to content

basf/shinyshval

Repository files navigation

shinyshval

CRAN status R build status Codecov test coverage

The goal of shinyshval is to provide a user-friendly shiny-application as interface to SHVAL tool developed by EFSA. It computes shortcut values (SV) as an estimate for the expected oral uptake of plant protection products residues by bees.

shinyshval

  • wraps original scripts SHVAL_NoT_v1.1.R and SHVAL_TWA_v1.1.R into functions & a package
  • provides sensible default parameters
  • adds a significant amount of tests to check for valid results
  • provides a user-friendly shiny application as interface.

Demo

You can fire-up a demo application on binder: Binder

Installation

You can install the app-package from github via

install.packages("remotes")
remotes::install_github("basf/shinyshval")

Starting the app locally

Simply run

shinyshval::run_app()

Using the backend

shinyshval tries to provide sensible default parameters for the different scenarious. These have been extracted from the guideline as good as possible (see ?default_estimates). Especially for RUD values users are welcome to adapt their needs.

We can compute shval values for default parameters of Honey Bee foragers.

First we retrieve the defaults

# retrieve defaults
defaults <- shinyshval::default_estimates(species = "Honey Bee", 
                                          stadium = "larvae")

Than we estimate the parameters for the default inputs

param <- shinyshval::get_param(raw = NULL, est = defaults)

And finally we can simulate the SHVAL values

shvals <- shinyshval::sim(param)

These can than be summarized in different ways

hist(shvals)

# Mean
mean(shvals)
#> [1] 4.259501
# 95% CI
quantile(shvals, c(0.025, 0.975))
#>     2.5%    97.5% 
#> 3.786495 4.790376

Quality assurance

In order to ensure consistent results between the shinyshval and original EFSA SHVAL tool, the package is under version control and an extensive set of tests have been implemented using testthat.

In short, a total number of 234 continuously integrated tests are run on each code change. These tests that cover 100% of back-end functionality.

  • 156 for the internal functioning of function for the app
  • 42 tests comprise of 7 scenarios (6 each) specifically aimed at comparison of results with the original EFSA script
  • 45 tests reproducing tables J4-J8 of the guideline

Because of the non-deterministic nature of the computations, comparisons are made with a precision of 1x10^{-1} to 1x10^{-2}. Reference results form the original script can be found in the inst/test_referencefor each scenario.

Disclaimer

shinyshval is released with agreement of EFSA under EUPL-1.2 open source license. According to articles 7 and 8 of the EUPL-1.2 license EFSA is not responsible for errors, omissions or deficiencies regarding shinyshval; shinyshval is being made available as such without any warranty either expressed or implied, including, but not limited to, warranties of performance, merchantability, and fitness for a particular purpose; In no event shall EFSA be liable for direct, indirect, special, incidental, or consequential damages resulting from the use, misuse, or inability to use shinyshval.

About

No description, website, or topics provided.

Resources

License

EUPL-1.2, Unknown licenses found

Licenses found

EUPL-1.2
LICENSE
Unknown
LICENSE.note

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published