From 5700ac688f1f384c1b3221f0345cd6a68927448e Mon Sep 17 00:00:00 2001 From: Sebastian Henz <sebastian.henz@ufz.de> Date: Mon, 19 Oct 2020 17:24:44 +0200 Subject: [PATCH] Generate the readme with an rmd file, closes #31 --- .Rbuildignore | 1 + README.Rmd | 114 ++++++++++++++++++++++++++++ README.md | 123 ++++++++++++++++++++----------- images/README-example_plot-1.png | 3 + images/example.png | 3 - 5 files changed, 197 insertions(+), 47 deletions(-) create mode 100644 README.Rmd create mode 100644 images/README-example_plot-1.png delete mode 100644 images/example.png diff --git a/.Rbuildignore b/.Rbuildignore index 62e866b..b1576fe 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -11,3 +11,4 @@ ^images$ ^cran-comments\.md$ ^check-results$ +^README\.Rmd$ diff --git a/README.Rmd b/README.Rmd new file mode 100644 index 0000000..05719f6 --- /dev/null +++ b/README.Rmd @@ -0,0 +1,114 @@ +--- +output: github_document +--- + +<!-- README.md is generated from README.Rmd. Please edit that file --> + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + fig.path = "images/README-", + out.width = "100%" +) +``` + +# stressaddition +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()`. + +`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. Modeling the synergistic effects of toxicant mixtures. Environ Sci Eur 32, 119 (2020)](https://doi.org/10.1186/s12302-020-00394-7). + +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 +This package is available from CRAN: +```{r eval=FALSE} +install.packages("stressaddition") +``` +You can also get the development version (potentially unstable) from GitLab: +```{r eval=FALSE} +install.packages("remotes") +remotes::install_gitlab("oekotox/stressaddition", host = "git.ufz.de") +``` +Alternatively, there are binary and source builds of the current release and older versions available for download from the [releases page](https://git.ufz.de/oekotox/stressaddition/-/releases). + + +## Examples + +### EC<sub>x-SyS</sub> +Model a concentration-response relationship with hormesis: +```{r} +library(stressaddition) +model_a <- ecxsys( + concentration = c(0, 0.05, 0.5, 5, 30), + survival_tox_observed = c(90, 81, 92, 28, 0), + survival_tox_env_observed = c(29, 27, 33, 5, 0), + hormesis_concentration = 0.5 +) +``` + +Calculate the LC<sub>50</sub> under the influence of toxicant and system stress and the LC<sub>10</sub> under the influence of toxicant, environmental and system stress: +```{r} +lc(model_a, "survival_tox_sys", 50) +lc(model_a, "survival_tox_env_sys", 10) +``` + +Plot the survival and the system stresses: +```{r example_plot} +par(mfrow = c(2, 1), mar = c(4, 4, 0.5, 0.1)) +plot_survival(model_a) +plot_stress(model_a) +``` + +### 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] +``` + + +## Citation +Please cite this package if you use it in your analysis. See `citation("stressaddition")` for details. + + +## Copyright and License +Copyright (c) 2020, +Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ. +All rights reserved. + +The code is a property of: + +Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +Registered Office: Leipzig +Registration Office: Amtsgericht Leipzig +Trade Register: Nr. B 4703 +Chairman of the Supervisory Board: MinDirig'in Oda Keppler +Scientific Director: Prof. Dr. Georg Teutsch +Administrative Director: Dr. Sabine König + + +stressaddition is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <https://www.gnu.org/licenses/>. diff --git a/README.md b/README.md index 0f36838..4ac01e7 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,58 @@ -# stressaddition -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()`. -`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. +<!-- README.md is generated from README.Rmd. Please edit that file --> -`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. Modeling the synergistic effects of toxicant mixtures. Environ Sci Eur 32, 119 (2020)](https://doi.org/10.1186/s12302-020-00394-7). +# stressaddition -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. +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()`. + +`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. Modeling the synergistic effects of toxicant mixtures. Environ Sci +Eur 32, 119 (2020)](https://doi.org/10.1186/s12302-020-00394-7). + +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 + This package is available from CRAN: + ``` r install.packages("stressaddition") ``` -You can also get it from GitLab but this is the development version and may be unstable: + +You can also get the development version (potentially unstable) from +GitLab: + ``` r install.packages("remotes") remotes::install_gitlab("oekotox/stressaddition", host = "git.ufz.de") ``` -Alternatively, there are binary and source builds of the current release and older 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. +Alternatively, there are binary and source builds of the current release +and older versions available for download from the [releases +page](https://git.ufz.de/oekotox/stressaddition/-/releases). ## Examples ### EC<sub>x-SyS</sub> + Model a concentration-response relationship with hormesis: -```R + +``` r library(stressaddition) model_a <- ecxsys( concentration = c(0, 0.05, 0.5, 5, 30), @@ -37,36 +62,41 @@ model_a <- ecxsys( ) ``` -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 +Calculate the LC<sub>50</sub> under the influence of toxicant and system +stress and the LC<sub>10</sub> under the influence of toxicant, +environmental and system stress: -# LC10 under the influence of toxicant, environmental and system stress: +``` r +lc(model_a, "survival_tox_sys", 50) +#> $response +#> [1] 44.95368 +#> +#> $concentration +#> [1] 3.375735 lc(model_a, "survival_tox_env_sys", 10) -# $response -# [1] 26.41904 -# -# $concentration -# [1] 0.0008571244 +#> $response +#> [1] 26.41904 +#> +#> $concentration +#> [1] 0.0008571244 ``` 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) + +``` r +par(mfrow = c(2, 1), mar = c(4, 4, 0.5, 0.1)) +plot_survival(model_a) +plot_stress(model_a) ``` - + +<img src="images/README-example_plot-1.png" width="100%" /> ### Multi-TOX -Define an additional single toxicant model and calculate the survival for some binary concentration mixtures: -```R + +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), @@ -78,14 +108,20 @@ multi_tox( 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 +#> 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 ``` +## Citation + +Please cite this package if you use it in your analysis. See +`citation("stressaddition")` for details. + ## Copyright and License + Copyright (c) 2020, Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ. All rights reserved. @@ -96,10 +132,9 @@ Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ Registered Office: Leipzig Registration Office: Amtsgericht Leipzig Trade Register: Nr. B 4703 -Chairman of the Supervisory Board: MinDirig'in Oda Keppler -Scientific Director: Prof. Dr. Georg Teutsch -Administrative Director: Dr. Sabine König - +Chairman of the Supervisory Board: MinDirig’in Oda Keppler +Scientific Director: Prof. Dr. Georg Teutsch +Administrative Director: Dr. Sabine König stressaddition is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -108,8 +143,8 @@ the Free Software Foundation, either version 3 of the License, or This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with this program. If not, see <https://www.gnu.org/licenses/>. +along with this program. If not, see <https://www.gnu.org/licenses/>. diff --git a/images/README-example_plot-1.png b/images/README-example_plot-1.png new file mode 100644 index 0000000..240fb8d --- /dev/null +++ b/images/README-example_plot-1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d70ffc13672fd8489d5a8382c86b5b488fee321d1daf3185c7f4d0abdf2fc06 +size 5828 diff --git a/images/example.png b/images/example.png deleted file mode 100644 index 224712b..0000000 --- a/images/example.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:16a0b141b74374575d019a95d37ff881dca10ab45aaf3291c9a0c6e7f2124a00 -size 12905 -- GitLab