Title: | Modelling Tri-Phasic Concentration-Response Relationships |
---|---|
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 experiments, in combination with an environmental stressor or as mixtures of two toxicants. See Liess et al. (2019) <doi:10.1038/s41598-019-51645-4> and Liess et al. (2020) <doi:10.1186/s12302-020-00394-7>. |
Authors: | Sebastian Henz [aut, cre]
|
Maintainer: | Sebastian Henz <[email protected]> |
License: | GPL-3 |
Version: | 3.1.0 |
Built: | 2025-03-01 04:06:54 UTC |
Source: | https://github.com/cran/stressaddition |
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 experiments, in combination with an environmental stressor or as mixtures of two toxicants. See Liess et al. (2019) <doi:10.1038/s41598-019-51645-4> and Liess et al. (2020) <doi:10.1186/s12302-020-00394-7>.
This R package contains the definitions of the ECx-SyS model and the Multi-TOX model. See the publications linked below for more information including equations.
Author contributions: M. Liess conceived the ECx-SyS and Multi-TOX models. S. Henz developed this R package. N. Shahid contributed to the optimization of the Multi-TOX model and provided the multiple_stress data set.
Maintainer: Sebastian Henz [email protected] (ORCID)
Authors:
Matthias Liess (ORCID)
Other contributors:
Naeem Shahid (ORCID) [contributor]
Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ [copyright holder, funder]
Useful links:
ECx-SyS is a model for tri-phasic concentration-response relationships where hormetic and subhormetic effects are observed at low concentrations. It expands the Stress Addition Model (SAM) by introducing system stress (SyS) which is negatively correlated with toxicant stress. A constant environmental stress can be included. See the publication for details.
ecxsys( concentration, hormesis_concentration, survival_tox_observed, survival_tox_env_observed = NULL, survival_max = 100, curves_concentration_max = NULL, p = 3.2, q = 3.2 )
ecxsys( concentration, hormesis_concentration, survival_tox_observed, survival_tox_env_observed = NULL, survival_max = 100, curves_concentration_max = NULL, p = 3.2, q = 3.2 )
concentration |
A vector of concentrations. Must be sorted in ascending order and the first element must be 0 to indicate the control. |
hormesis_concentration |
The concentration where the hormesis occurs. This is usually the concentration of the highest survival after the control. |
survival_tox_observed |
A vector of survival values observed at the given
concentrations and in absence of environmental stress. Values must be
between 0 and |
survival_tox_env_observed |
Survival values observed in the presence of
environmental stress. Must be between 0 and |
survival_max |
The maximum value the survival could possibly reach. For survival data in percent this should be 100 (the default). |
curves_concentration_max |
The maximum concentration of the predicted curves. This might be useful if for example your highest observed concentration is 30 but you would like to know the predicted values on a scale between 0 and 100. |
p , q
|
The shape parameters of the beta distribution. Default is
|
It is advised to complete the curve down to zero for optimal prediction.
Therefore survival_tox_observed
in the highest concentration should be
at or close to zero. If the model does not fit properly try adding a survival
of 0 at ten times the maximum observed concentration.
The vectors concentration
, survival_tox_observed
and
survival_tox_env_observed
(if provided) must be of equal length and
sorted by increasing concentration.
A list (of class ecxsys) containing many different objects of which the most important are listed below. The survival and stress vectors correspond to the provided concentrations.
Modeled survival resulting from toxicant stress.
Modeled survival resulting from toxicant and system stress.
Modeled survival resulting from toxicant and environmental stress.
Modeled survival resulting from toxicant, environmental and system stress.
The survival predicted by the five-parameter log-logistic model derived from the observations under toxicant stress but without environmental stress.
The survival predicted by the five-parameter log-logistic model derived from the observations under toxicant stress with environmental stress.
A data frame containing survival and stress values as
returned by predict_ecxsys
. The concentrations are
regularly spaced on a logarithmic scale in the given concentration range.
The control is approximated by the lowest non-control concentration times
1e-7. The additional column concentration_for_plots
is used by the
plotting functions of this package to approximate the control and
generate a nice concentration axis.
model <- 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) ) # Use survival_max if for example the survival is given as the average number # of surviving animals and the initial number of animals is 21: model <- ecxsys( concentration = c(0, 0.03, 0.3, 3, 30), hormesis_concentration = 0.3, survival_tox_observed = c(17, 15.2, 18.8, 7, 0), survival_tox_env_observed = c(4.8, 4.6, 6.4, 0, 0), survival_max = 21 )
model <- 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) ) # Use survival_max if for example the survival is given as the average number # of surviving animals and the initial number of animals is 21: model <- ecxsys( concentration = c(0, 0.03, 0.3, 3, 30), hormesis_concentration = 0.3, survival_tox_observed = c(17, 15.2, 18.8, 7, 0), survival_tox_env_observed = c(4.8, 4.6, 6.4, 0, 0), survival_max = 21 )
Estimate the concentration to reach a certain mortality relative to the control.
lc(model, response_name, response_level, reference, warn = TRUE)
lc(model, response_name, response_level, reference, warn = TRUE)
model |
This can be one of three types of objects: Either the output of
|
response_name |
The name of the survival or stress for which you want to calculate the LC. |
response_level |
The desired response level as a percentage between 0 and 100. For example with the value 10 the function will return the LC10, i.e. the concentration where the response falls below 90 % of the control response. In other words: where a mortality of 10 % relative to the control is reached. |
reference |
The reference value of the response, usually the control at
concentration 0. This argument is optional. If it is missing, the first
value of the response is used as control. This value determines what number
|
warn |
Logical. Should the function emit a warning if the calculation of the lethal concentration is not possible? |
If the response level occurs multiple times because of hormesis, which may
happen for low values of response_level
, then the occurrence with the
smallest concentration is returned.
This function only makes sense for curves which generally go down with
increasing concentration, i.e. all survival_*
curves and also
sys_tox
and sys_tox_env
. Others are untested and may give
unexpected results, if any.
A list containing the lethal concentration and the corresponding
survival. The survival will be NA
if its calculation is impossible
using the supplied data.
# Calculate the LC10, the concentration where the survival falls # below 90% of the survival in the control. model <- ecxsys( concentration = c(0, 0.05, 0.5, 5, 30), hormesis_concentration = 0.5, survival_tox_observed = c(90, 81, 92, 28, 0) ) # using the ecxsys() output or the curves therein directly: lc(model, "survival_tox_sys", 10) lc(model$curves, "survival_tox_sys", 10) # using the output of predict_ecxsys() with custom concentrations: conc <- 10^seq(-9, 1, length.out = 1000) curves <- predict_ecxsys(model, conc) lc(curves, "survival_tox_sys", 10) # using a custom data frame: df_custom <- data.frame( concentration = curves$concentration, foo = curves$survival_tox_sys ) lc(df_custom, "foo", 10) # Calculate the LC50 relative to an survival of 100 # instead of relative to the control: lc(model, "survival_tox_sys", 50, reference = 100)
# Calculate the LC10, the concentration where the survival falls # below 90% of the survival in the control. model <- ecxsys( concentration = c(0, 0.05, 0.5, 5, 30), hormesis_concentration = 0.5, survival_tox_observed = c(90, 81, 92, 28, 0) ) # using the ecxsys() output or the curves therein directly: lc(model, "survival_tox_sys", 10) lc(model$curves, "survival_tox_sys", 10) # using the output of predict_ecxsys() with custom concentrations: conc <- 10^seq(-9, 1, length.out = 1000) curves <- predict_ecxsys(model, conc) lc(curves, "survival_tox_sys", 10) # using a custom data frame: df_custom <- data.frame( concentration = curves$concentration, foo = curves$survival_tox_sys ) lc(df_custom, "foo", 10) # Calculate the LC50 relative to an survival of 100 # instead of relative to the control: lc(model, "survival_tox_sys", 50, reference = 100)
Calculate the positions and labels of major and minor tick marks for a base 10 logarithmic axis.
log10_ticks(x, label_zero = TRUE)
log10_ticks(x, label_zero = TRUE)
x |
A vector of axis values. Can be arbitrarily long but only the minimum and maximum are necessary. |
label_zero |
Whether or not to replace the smallest major label with
"0". This defaults to |
A list with the positions and labels of the major and minor tick
marks. The labels are formatted without trailing zeros using
formatC(labels, format = "fg")
.
x <- c(0.01, 0.2, 3, 10, 50) plot(x, c(5, 4, 2.5, 1, 0), xaxt = "n", log = "x") ticks <- log10_ticks(x) axis(1, at = ticks$major, labels = ticks$major_labels) axis(1, at = ticks$minor, labels = FALSE, tcl = -0.25)
x <- c(0.01, 0.2, 3, 10, 50) plot(x, c(5, 4, 2.5, 1, 0), xaxt = "n", log = "x") ticks <- log10_ticks(x) axis(1, at = ticks$major, labels = ticks$major_labels) axis(1, at = ticks$minor, labels = FALSE, tcl = -0.25)
The Multi-TOX model predicts the effects of binary toxicant mixtures based on three-phasic concentration-response relationships. See the publication for details.
multi_tox( model_a, model_b, concentration_a, concentration_b, sa_contribution = 0.5, survival_max = 100 )
multi_tox( model_a, model_b, concentration_a, concentration_b, sa_contribution = 0.5, survival_max = 100 )
model_a , model_b
|
The ecxsys models of the toxicants. |
concentration_a , concentration_b
|
The concentrations of the toxicants in the mixture. Both vectors must either be the same length or the longer length must be a multiple of the shorter length. That's because the shorter concentration vector gets recycled to the length of the longer one. |
sa_contribution |
The proportion of stress addition contributing to the calculation of the toxicant stress in the mixture. Must be between 0 and 1 where 1 stands for 100 % stress addition. |
survival_max |
Controls the scaling of the result. This represents the maximum value the survival could possibly reach. For survival data in percent this should be 100 (the default). |
The predictions are symmetric, i.e. it does not matter which of the toxicant models is a or b as long as the concentration arguments are supplied in the same order.
This method is only suitable for experiments without or with low
environmental stress. Any environmental stress supplied as arguments to
ecxsys
in model_a
or model_b
is ignored.
A data frame with columns of the supplied concentrations and the corresponding mixture survival and stresses.
# Using a data set which is included in this package. See ?multiple_stress ms <- multiple_stress esfen <- ms[ms$food == 1 & ms$prochloraz == 0, ] proch <- ms[ms$food == 1 & ms$esfenvalerate == 0, ] model_esfen <- ecxsys( concentration = esfen$esfenvalerate, survival_tox_observed = esfen$survival, hormesis_concentration = 0.1 ) model_proch <- ecxsys( concentration = proch$prochloraz, survival_tox_observed = proch$survival, hormesis_concentration = 100 ) # Predict the survival at 8 different esfenvalerate concentrations # but keep the prochloraz concentration constant at 32: mt <- multi_tox( model_esfen, model_proch, c(0, 0.0001, 0.001, 0.01, 0.1, 0.316, 1, 3.16), 32, sa_contribution = 0.8 ) mt[1:3] # The concentrations and survival of the 8 mixtures. # Predict the survival at 4 different combinations # of esfenvalerate and prochloraz: mt <- multi_tox( model_esfen, model_proch, c(0.1, 0.2, 0.3, 0.4), c(0, 1, 32, 100), sa_contribution = 0.8 ) mt[1:3] # The concentrations and survival of the 4 mixtures.
# Using a data set which is included in this package. See ?multiple_stress ms <- multiple_stress esfen <- ms[ms$food == 1 & ms$prochloraz == 0, ] proch <- ms[ms$food == 1 & ms$esfenvalerate == 0, ] model_esfen <- ecxsys( concentration = esfen$esfenvalerate, survival_tox_observed = esfen$survival, hormesis_concentration = 0.1 ) model_proch <- ecxsys( concentration = proch$prochloraz, survival_tox_observed = proch$survival, hormesis_concentration = 100 ) # Predict the survival at 8 different esfenvalerate concentrations # but keep the prochloraz concentration constant at 32: mt <- multi_tox( model_esfen, model_proch, c(0, 0.0001, 0.001, 0.01, 0.1, 0.316, 1, 3.16), 32, sa_contribution = 0.8 ) mt[1:3] # The concentrations and survival of the 8 mixtures. # Predict the survival at 4 different combinations # of esfenvalerate and prochloraz: mt <- multi_tox( model_esfen, model_proch, c(0.1, 0.2, 0.3, 0.4), c(0, 1, 32, 100), sa_contribution = 0.8 ) mt[1:3] # The concentrations and survival of the 4 mixtures.
A data set of mixture toxicity experiments. Individuals of Daphnia magna were exposed to combinations of food stress and multiple concentrations of the pesticides esfenvalerate and prochloraz. The survival was recorded at 21 days after contamination.
multiple_stress
multiple_stress
A data frame with 58 rows and 4 variables:
The amount of food in percent.
The concentration of esfenvalerate in µg/L.
The concentration of prochloraz in µg/L.
The mean survival in percent.
Plot the observed and modeled survivals and stresses.
plot_stress( model, which = c("sys_tox", "sys_tox_observed", "sys_tox_env", "sys_tox_env_observed"), show_legend = FALSE, xlab = "concentration", ylab = "stress", main = NULL ) plot_survival( model, which = c("survival_tox", "survival_tox_sys", "survival_tox_observed", "survival_tox_env", "survival_tox_env_sys", "survival_tox_env_observed"), show_legend = FALSE, xlab = "concentration", ylab = "survival", main = NULL )
plot_stress( model, which = c("sys_tox", "sys_tox_observed", "sys_tox_env", "sys_tox_env_observed"), show_legend = FALSE, xlab = "concentration", ylab = "stress", main = NULL ) plot_survival( model, which = c("survival_tox", "survival_tox_sys", "survival_tox_observed", "survival_tox_env", "survival_tox_env_sys", "survival_tox_env_observed"), show_legend = FALSE, xlab = "concentration", ylab = "survival", main = NULL )
model |
The model object returned from |
which |
A vector of curve names to plot. Allowed are all values of
|
show_legend |
Should the plot include a legend? Defaults to |
xlab , ylab , main
|
Axis labels and title. |
None
model <- 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) ) plot_survival(model, show_legend = TRUE) plot_stress(model, show_legend = TRUE) # Plot all curves: plot_survival(model, which = "all") plot_stress(model, which = "all") # Plot only some selected curves: plot_survival(model, which = c("survival_tox_sys", "survival_tox_env_sys")) plot_stress(model, which = c("sys_tox", "sys_tox_env")) # Plot only the observed values: plot_survival(model, which = c("survival_tox_observed", "survival_tox_env_observed")) plot_stress(model, which = c("sys_tox_observed", "sys_tox_env_observed"))
model <- 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) ) plot_survival(model, show_legend = TRUE) plot_stress(model, show_legend = TRUE) # Plot all curves: plot_survival(model, which = "all") plot_stress(model, which = "all") # Plot only some selected curves: plot_survival(model, which = c("survival_tox_sys", "survival_tox_env_sys")) plot_stress(model, which = c("sys_tox", "sys_tox_env")) # Plot only the observed values: plot_survival(model, which = c("survival_tox_observed", "survival_tox_env_observed")) plot_stress(model, which = c("sys_tox_observed", "sys_tox_env_observed"))
Calculate the survivals and stresses of an ECx-SyS model at arbitrary concentrations.
predict_ecxsys(model, concentration)
predict_ecxsys(model, concentration)
model |
An ECx-SyS model as returned by |
concentration |
A numeric vector of concentrations. |
A data frame (of class "ecxsys_predicted") with the following columns:
The supplied concentrations.
The survival predicted by the five-parameter log-logistic model derived from the observations under toxicant stress but without environmental stress.
Modeled survival resulting from toxicant stress.
Modeled survival resulting from toxicant and system stress.
The toxicant stress.
System stress under toxicant stress conditions without environmental stress.
The sum of stress_tox
and
sys_tox
.
The survival predicted by the five-parameter log-logistic model derived from the observations under toxicant stress with environmental stress.
Modeled survival resulting from toxicant and environmental stress.
Modeled survival resulting from toxicant, environmental and system stress.
Environmental stress.
The sum of toxicant and environmental stress.
System stress under toxicant and environmental stress conditions.
The sum of stress_tox_env
and
sys_tox_env
.
model <- 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) ) p <- predict_ecxsys(model, c(0.001, 0.01, 0.1, 1, 10))
model <- 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) ) p <- predict_ecxsys(model, c(0.001, 0.01, 0.1, 1, 10))
Functions to convert survival to general stress or vice versa using the beta distribution.
survival_to_stress(survival, p = 3.2, q = 3.2) stress_to_survival(stress, p = 3.2, q = 3.2)
survival_to_stress(survival, p = 3.2, q = 3.2) stress_to_survival(stress, p = 3.2, q = 3.2)
survival |
One or more survival values to convert to general stress. Should be a value between 0 and 1. Smaller or bigger values are treated as 0 or 1 respectively. |
p , q
|
The shape parameters of the |
stress |
One or more stress values to convert to survival. |
These are simple wrappers around the beta distribution function
pbeta
and the beta quantile function
qbeta
.
stress_to_survival
returns a vector the same length as
stress
giving the survival caused by each amount of stress.
survival_to_stress
returns a vector the same length as
survival
containing the stress values associated with each survival.
stress <- 0.3 survival <- stress_to_survival(stress) survival_to_stress(survival)
stress <- 0.3 survival <- stress_to_survival(stress) survival_to_stress(survival)