From 03da0450613a470b7dff6aa17901d9da820bc8d3 Mon Sep 17 00:00:00 2001 From: Sebastian Henz <sebastian.henz@ufz.de> Date: Mon, 6 Jul 2020 16:47:16 +0200 Subject: [PATCH] Improve the readme --- .Rbuildignore | 1 + .gitattributes | 1 + .gitignore | 1 - DESCRIPTION | 6 +-- README.md | 87 +++++++++++++++++++++++++---------- images/example.png | 3 ++ man/stressaddition-package.Rd | 2 +- 7 files changed, 71 insertions(+), 30 deletions(-) create mode 100644 .gitattributes create mode 100644 images/example.png diff --git a/.Rbuildignore b/.Rbuildignore index 99b26c0..a8d197a 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,3 +8,4 @@ ^\.gitlab$ ^\.gitlab-ci\.yml$ ^data-raw$ +^images$ diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..24a8e87 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.png filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore index eddaf3d..065f561 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,3 @@ .Ruserdata Notizen.md -*.png diff --git a/DESCRIPTION b/DESCRIPTION index 0afe62b..2b2edea 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: stressaddition Type: Package Title: Modelling Tri-Phasic Concentration-Response Relationships Version: 3.0.0 -Date: 2020-05-18 +Date: 2020-07-06 Authors@R: c(person("Sebastian", "Henz", role = c("aut", "cre"), @@ -17,7 +17,7 @@ Authors@R: c(person("Sebastian", role = "ctb", comment = c(ORCID = "0000-0001-6581-1654")), person("Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ", - role = c("cph"))) + role = c("cph", "fnd"))) Description: The stress addition approach is an alternative to the traditional concentration addition or effect addition models. It allows the modelling of tri-phasic concentration-response relationships either as single toxicant @@ -35,4 +35,4 @@ Imports: plotrix Suggests: testthat (>= 2.1.0) -RoxygenNote: 7.1.0 +RoxygenNote: 7.1.1 diff --git a/README.md b/README.md index b92fa6f..5e7da03 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,84 @@ # stressaddition -This is the R implementation of the tri-phasic concentration-response model introduced in -[Liess, M., Henz, S. & Knillmann, S. Predicting low-concentration effects of pesticides. Sci Rep 9, 15248 (2019)](https://doi.org/10.1038/s41598-019-51645-4). It allows modeling of ecotoxicological experiments where the response shows signs of a hormesis effect. +This R package makes it possible to model tri-phasic concentration-response relationships using the stress addition approach. It is useful for the analysis of ecotoxicological data where the traditional concentration addition or effect addition models are inadequate. Its main functions are `ecxsys()` and `multi_tox()`. -The EC<sub>x-SyS</sub> and Multi-TOX models from this package are also available as part of the [Indicate app](http://www.systemecology.eu/indicate) which offers a graphical user interface. +`ecxsys()` implements **EC<sub>x-SyS</sub>**, the tri-phasic concentration-response model introduced in +[Liess, M., Henz, S. & Knillmann, S. Predicting low-concentration effects of pesticides. Sci Rep 9, 15248 (2019)](https://doi.org/10.1038/s41598-019-51645-4). It is applicable to modelling ecotoxicological experiments with and without environmental stress where the response contains a hormesis effect. + +`multi_tox()` implements **Multi-TOX**, a model for binary mixtures of toxicants where each toxicant exhibits a tri-phasic concentration-response relationship. See *Liess, M., Henz, S., Shahid, N. (2020), Modelling the synergistic effects of toxicant mixtures. Manuscript submitted for publication*. + +The EC<sub>x-SyS</sub> and Multi-TOX models are also available as part of the [Indicate app](http://www.systemecology.eu/indicate) which offers an easy to use graphical user interface. ## Installation -Stressaddition is not yet on CRAN. You can install the most recent development version from GitLab using the remotes package: +This package is not yet available on CRAN. Until then you can install the most recent version from GitLab using the remotes package: ``` r install.packages("remotes") remotes::install_gitlab("oekotox/stressaddition", host = "git.ufz.de") ``` -Alternatively there are binary and source builds of various versions downloadable from the [releases page](https://git.ufz.de/oekotox/stressaddition/-/releases). - -## Updating -RStudio's integrated package updater won't detect updates in packages installed from GitHub or GitLab. I recommend running -```r -remotes::update_packages() -``` -in regular intervals to check for updates from those sources. +Alternatively, there are binary and source builds of various versions available for download from the [releases page](https://git.ufz.de/oekotox/stressaddition/-/releases). ## Citation Please cite this package if you use it in your analysis. See `citation("stressaddition")` for details. -## Example -```r +## Examples + +### EC<sub>x-SyS</sub> +Model a concentration-response relationship with hormesis: +```R library(stressaddition) -model <- ecxsys( +model_a <- ecxsys( concentration = c(0, 0.05, 0.5, 5, 30), - hormesis_concentration = 0.5, survival_tox_observed = c(90, 81, 92, 28, 0), - survival_tox_env_observed = c(29, 27, 33, 5, 0) + survival_tox_env_observed = c(29, 27, 33, 5, 0), + hormesis_concentration = 0.5 ) +``` -# Plot the effect and the system stress: -par(mfrow = c(2, 1)) -plot_survival(model) -plot_stress(model) +Calculate the LC<sub>50</sub> and LC<sub>10</sub>: +```R +# LC50 under the influence of toxicant and system stress: +lc(model_a, "survival_tox_sys", 50) +# $response +# [1] 44.95368 +# +# $concentration +# [1] 3.375735 + +# LC10 under the influence of toxicant, environmental and system stress: +lc(model_a, "survival_tox_env_sys", 10) +# $response +# [1] 26.41904 +# +# $concentration +# [1] 0.0008571244 +``` -# The LC50 under the influence of toxicant and system tress: -lc(model, "survival_tox_sys", 50) +Plot the survival and the system stresses: +```R +par(mfrow = c(2, 1)) +plot_survival(model_a, show_legend = TRUE) +plot_stress(model_a, show_legend = TRUE) +``` + -# The LC10 under the influence of toxicant, system and environmental tress: -lc(model, "survival_tox_env_sys", 10) +### Multi-TOX +Define an additional single toxicant model and calculate the survival for some binary concentration mixtures: +```R +model_b <- ecxsys( + concentration = c(0, 0.01, 0.1, 1, 10, 100), + survival_tox_observed = c(96, 89, 91, 57, 9, 0), + hormesis_concentration = 0.1 +) +multi_tox( + model_a, + model_b, + concentration_a = c(0.1, 0.3, 2, 15), + concentration_b = c(0.04, 0.1, 1, 13) +)[, 1:3] +# concentration_a concentration_b survival +# 1 0.1 0.04 84.44956 +# 2 0.3 0.10 73.53734 +# 3 2.0 1.00 13.38661 +# 4 15.0 13.00 0.00000 ``` ## Copyright and License diff --git a/images/example.png b/images/example.png new file mode 100644 index 0000000..224712b --- /dev/null +++ b/images/example.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:16a0b141b74374575d019a95d37ff881dca10ab45aaf3291c9a0c6e7f2124a00 +size 12905 diff --git a/man/stressaddition-package.Rd b/man/stressaddition-package.Rd index 795b1ee..cf59dfb 100644 --- a/man/stressaddition-package.Rd +++ b/man/stressaddition-package.Rd @@ -47,7 +47,7 @@ Authors: Other contributors: \itemize{ \item Naeem Shahid (\href{https://orcid.org/0000-0001-6581-1654}{ORCID}) [contributor] - \item Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ [copyright holder] + \item Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ [copyright holder, funder] } } -- GitLab