Title: | Web Application for the SSD Module of the MOSAIC Platform |
Version: | 1.0.3 |
Description: | Web application using 'shiny' for the SSD (Species Sensitivity Distribution) module of the MOSAIC (MOdeling and StAtistical tools for ecotoxICology) platform. It estimates the Hazardous Concentration for x% of the species (HCx) from toxicity values that can be censored and provides various plotting options for a better understanding of the results. See our companion paper Kon Kam King et al. (2014) <doi:10.48550/arXiv.1311.5772>. |
License: | MIT + file LICENSE |
URL: | https://gitlab.in2p3.fr/mosaic-software/mosaic-ssd, https://mosaic.univ-lyon1.fr/ |
BugReports: | https://gitlab.in2p3.fr/mosaic-software/mosaic-ssd/-/issues |
Depends: | R (≥ 4.1.0) |
Imports: | actuar, config (≥ 0.3.1), fitdistrplus (≥ 1.1-11), ggplot2, golem (≥ 0.3.5), htmltools, htmlwidgets, jsonlite, rhandsontable, rlang, rmarkdown, shiny (≥ 1.7.4), shinybusy, shinyjs, stats, utils |
Suggests: | knitr, remotes, spelling, testthat (≥ 3.0.0) |
VignetteBuilder: | knitr |
Config/testthat/edition: | 3 |
Encoding: | UTF-8 |
Language: | en-US |
LazyData: | true |
RoxygenNote: | 7.3.2 |
NeedsCompilation: | no |
Packaged: | 2025-03-11 08:42:18 UTC; siberchicot |
Author: | Aurélie Siberchicot
|
Maintainer: | Aurélie Siberchicot <aurelie.siberchicot@univ-lyon1.fr> |
Repository: | CRAN |
Date/Publication: | 2025-03-11 14:40:02 UTC |
Add confidence interval(s) to an existing fitted distribution ggplot
Description
Add confidence interval(s) to an existing fitted distribution ggplot
Usage
add_CI_plot(base_plot, bts, logscale, CI.level = 0.95)
Arguments
base_plot |
A ggplot object that depicts the fit(s) of the bootstrap(s). |
bts |
A list of |
logscale |
if |
CI.level |
A strictly positive numeric smaller than 1. The level of the confidence interval(s). |
Value
A ggplot object.
Graphical representation of fitted distribution(s)
Description
base_cdf
plots an empirical cdf of the toxicity values against one or
several fitted distributions' cdf. It works for both censored and non
censored data.
Usage
base_cdf(fits, unit, logscale, names = NULL, horizontals = TRUE, xlim = NULL)
Arguments
fits |
A list of fits of class |
unit |
A character vector, the unit of the toxicity data |
logscale |
if |
names |
Label vector for data points (only for non censored data) |
horizontals |
If |
xlim |
The |
Value
A ggplot object.
Determines the appropriate bootstrap function based on a fit object
Description
Determines the appropriate bootstrap function based on a fit object
Usage
bootdist_fun(x, ft, niter = 200)
Arguments
x |
Not used |
ft |
A |
niter |
An integer. The number of iterations set for the bootstrap function |
Value
An appropriate bootstrap function.
Graphical representation of censored data
Description
cens_lines_plot
create a plot representing each interval of toxicity
values with a horizontal line, or a point if the bounds of the interval are
equal. It is possible to color the lines by a grouping indicator.
Usage
cens_lines_plot(
data,
unit,
logscale,
fits = NULL,
leftNA = 0,
rightNA = Inf,
color_group = FALSE
)
Arguments
data |
A data.frame containing censored toxicity values. It must have
columns |
unit |
A character vector, the unit of the toxicity data |
logscale |
if |
fits |
A list of fits of class |
leftNA |
The value to replace censored left values. Default to 0 because toxicity values are concentrations. |
rightNA |
The value to replace censored right values. |
color_group |
if |
Value
A ggplot object.
Generate a script according to user in-app inputs
Description
Generate a script according to user in-app inputs
Usage
code_r_ssd(
data,
distributions,
censored = FALSE,
logscale = TRUE,
unit = "arbitrary unit",
names = FALSE,
groups = FALSE,
CI.level = 0.95
)
Arguments
data |
If |
distributions |
A list of the names of the distributions to apply (e.g.,
|
censored |
A Boolean, whether the given data is to be interpreted as censored |
logscale |
A logical |
unit |
A character string |
names |
A logical |
groups |
A logical |
CI.level |
A numerical |
Value
A character string containing a R script.
Combine several bootstrap samples into a single bootdist
or
bootdistcens
object
Description
Combine several bootstrap samples into a single bootdist
or
bootdistcens
object
Usage
combine_boot_samples(bs)
Arguments
bs |
A list of |
Value
A bootdist
or bootdistcens
object with a number of
samples equal to the sum of number of samples of each bootstrap from the
list input.
Custom ggplot theme created for MOSAIC bioacc overwriting theme_bw
Description
Custom ggplot theme created for MOSAIC bioacc overwriting theme_bw
Usage
custom_theme()
Summary of 48 to 96-hour acute toxicity values for endosulfan
Description
Summary of 48 to 96-hour acute toxicity values (LC50 and EC50 values) for exposure of Australian and Non-Australian taxa to endosulfan.
Usage
endosulfan
Format
endosulfan
A data frame with 88 rows and 3 columns:
- conc
Lethal or effective concentration in
\mu
g/L.- name
Specie's name for each concentration.
- group
Classification by geographical origin and type: fish or arthropod.
Source
48-hour acute toxicity values for fluazinam
Description
48-hour acute toxicity values (EC50 values) for exposure of macroinvertebrates and zooplancton to fluazinam.
Usage
fluazinam
Format
fluazinam
A data frame with 14 rows and 4 columns:
- left, right
Lower & higher bounds of the effective concentration interval in
\mu
g/L.- name
Specie's name for each effective concentration.
- group
Classification of the specie, not all rows use the same taxonomic rank.
Source
doi:10.1016/j.ecoenv.2009.09.019
Get HCx values from fit or bootstrap
Description
Get HC5, HC10, HC20 and HC50 for each fit provided, with confidence intervals if the corresponding bootstraps were provided.
Usage
get_HCx_table(fits, distributions, bootstrap = NULL, CI.level = 0.95)
Arguments
fits |
A list of fits of class |
distributions |
A list of the names of the distributions to apply (e.g.,
|
bootstrap |
A list of |
CI.level |
A numeric, either 0.95 or 0.9. The level of the confidence interval(s). |
Value
A data.frame with different HCx as rows and different fits as columns.
Generate bootstrap sample(s) for a list of fit(s) and check their convergence
Description
Generate bootstrap sample(s) for a list of fit(s) and check their convergence
Usage
get_bootstrap(fits)
Arguments
fits |
A list of |
Value
A list of two lists. The first list contains the bootstrap sample(s) and the second one the logical value of convergence.
Get HCx values for a given x from a bootstrap
Description
Get HCx corresponding to the provided x for each fit provided with confidence intervals
Usage
get_custom_HCx(x, distributions, bootstrap = NULL, CI.level = 0.95)
Arguments
x |
An integer between 0 and 100.The percent of the hazardous concentration desired (HCx). |
distributions |
A list of the names of the distributions to apply (e.g.,
|
bootstrap |
A list of |
CI.level |
A numeric, either 0.95 or 0.9. The level of the confidence interval(s). |
Value
A string describing the HCx and its confidence interval for each distribution.
Fit the specified distributions to the given data
Description
Fit the specified distributions to the given data
Usage
get_fits(data, distributions, censored)
Arguments
data |
If |
distributions |
A list of the names of the distributions to apply (e.g.,
|
censored |
A Boolean, whether the given data is to be interpreted as censored |
Value
A list containing the fit object(s) of class fitdist
or
fitdistcens
.
Get fit(s) parameters in HTML format for shiny outputs
Description
Get fit(s) parameters in HTML format for shiny outputs. Should do nothing if the fit is not ready, and should display limited information if the bootstrap is not done.
Usage
get_parameters_html(fits = NULL, bootstrap = NULL, CI.level = 0.95)
Arguments
fits |
A list of fits of class |
bootstrap |
A list of |
CI.level |
A numeric, either 0.95 or 0.9. The level of the confidence interval(s). |
Details
The output should look like: (once bootstrap is done)
**Log normal distribution**
*(log-likelihood = -161.8)*
meanlog: 1.1 [ 0.66 ; 1.5 ]
sdlog: 1.6 [ 1.3 ; 1.9 ]
Value
A character string with HTML formatting.
Create a label for x axis based on concentration unit and log scale
Description
Create a label for x axis based on concentration unit and log scale
Usage
get_xlab(unit, logscale)
Arguments
unit |
A character vector, the unit of the toxicity data |
logscale |
if |
Value
A character vector.
Graphical representation of grouped toxicity censored data
Description
Create an empirical cdf representation colored according to a "group" attribute. The fitted distribution is also represented.
Usage
group_cdf_censored(fits, unit, logscale, data)
Arguments
fits |
A list of fits of class |
unit |
A character vector, the unit of the toxicity data |
logscale |
if |
data |
A data.frame with columns |
Details
The plot represents each interval of toxicity values with a horizontal line,
or a point if the bounds of the interval are equal, using function
cens_lines_plot()
.
Value
A ggplot object.
Graphical representation of grouped toxicity uncensored data
Description
Add a group coloration to a provided empirical cdf representation according to a "group" column in data.
Usage
group_cdf_uncensored(data, p)
Arguments
data |
A data.frame with columns |
p |
a ggplot object showing the empirical cumulative distribution function of the uncensored data provided. |
Value
A ggplot object.
Create a pretty confidence interval ggplot
Description
Create a pretty confidence interval ggplot
Usage
my_CIcdfplot(b, logscale, CI.level)
Arguments
b |
One |
logscale |
if |
CI.level |
A strictly positive numeric smaller than 1. The level of the confidence interval(s). |
Value
A ggplot with 7 or 8 layers.
Note
With a bootdist
, the plot created has 8 layers. With a
bootdistcens
object, the plot created has 7 layers. The ribbon and
its delimiting lines are always the last 3 layers.
Graphical representation of named toxicity censored data
Description
Add names to a provided empirical cumulative distribution function ggplot (i.e.,species names).
Usage
name_plot_censored(data, p, leftNA = 0, rightNA = Inf)
Arguments
data |
A data.frame with column |
p |
A ggplot object showing the empirical cumulative distribution function of the censored data provided. |
leftNA |
The value to replace censored left values. Default to 0 because toxicity values are concentrations. |
rightNA |
The value to replace censored right values. |
Details
The positions of the names on the plot are based on the raw data visualization and not the non parametric maximum likelihood estimation (NPMLE) representation, but they can be added to both types of plot.
Compatible with plots colored by group labels.
Value
A ggplot object.
Graphical representation of named toxicity uncensored data
Description
Create an empirical cumulative distribution function ggplot with a name (i.e. species names) associated to each observation.
Usage
name_plot_uncensored(fits, unit, logscale, data, horizontals = TRUE)
Arguments
fits |
A list of fits of class |
unit |
A character vector, the unit of the toxicity data |
logscale |
if |
data |
A data.frame with column |
horizontals |
If |
Value
A ggplot object.
Graphical representation of toxicity data with additional elements
Description
Create an empirical cdf representation with the options to color data according to a group label and to display a name label for each observation.
Usage
options_plot(
fits,
unit,
logscale,
data,
use_names = FALSE,
use_groups = FALSE,
horizontals = TRUE,
lines_display = TRUE
)
Arguments
fits |
A list of fits of class |
unit |
A character vector, the unit of the toxicity data |
logscale |
if |
data |
A data.frame with column |
use_names |
if |
use_groups |
if |
horizontals |
A boolean. In case of uncensored data, whether to draw
horizontal lines for the step of the cumulative distribution function. Should
be set to |
lines_display |
A boolean. In case of censored data, whether to display
the raw data or the non parametric maximum likelihood estimation (NPMLE)
representation. Ignored when |
Value
A ggplot object.
Take a data.frame of censored toxicity data and order them like
fitdistrplus
plots
Description
Take a data.frame of censored toxicity data and order them like
fitdistrplus
plots
Usage
order_cens_data(data)
Arguments
data |
A data.frame of censored data with columns |
Value
A data.frame with ordered toxicity values.
Note
Left censored data are put in first, based on the value of their right bound, then non censored data are ordered based on their average value. The right censored data are put in last, ordered among themselves by their left bound.
Objects exported from other packages
Description
These objects are imported from other packages. Follow the links below to see their documentation.
Run the Shiny Application
Description
Run the Shiny Application
Usage
run_app(
onStart = NULL,
options = list(),
enableBookmarking = NULL,
uiPattern = "/",
...
)
Arguments
onStart |
A function that will be called before the app is actually run.
This is only needed for |
options |
Named options that should be passed to the |
enableBookmarking |
Can be one of |
uiPattern |
A regular expression that will be applied to each |
... |
arguments to pass to golem_opts. See '?golem::get_golem_options' for more details. |
Value
No return value, called for side effects
72-hour acute salinity tolerance of macro-invertebrates grouped by family.
Description
72-hour acute salinity tolerance (LC50 values) of riverine macro-invertebrates grouped by taxonomic family.
Usage
salinity_family
Format
Salinity_order
A data frame with 108 rows and 3 columns:
- left, right
Lower & higher bounds of the lethal concentration interval in mS/cm
^2
.- group
Family of each tested specie.
Source
72-hour acute salinity tolerance of macro-invertebrates grouped by order.
Description
72-hour acute salinity tolerance (LC50 values) of riverine macro-invertebrates grouped by taxonomic order.
Usage
salinity_order
Format
Salinity_order
A data frame with 108 rows and 3 columns:
- left, right
Lower & higher bounds of the lethal concentration interval in mS/cm
^2
.- group
Order of each tested specie.
Source
Custom toggle switch input for shiny UI
Description
Custom toggle switch input for shiny UI
Usage
switchInput(id, aria_label, checked = TRUE)
Arguments
id |
The |
aria_label |
An invisible label for screen readers. |
checked |
Whether to create the switch as ON. |
Value
A toggle switch control that can be added to a UI definition.
Test the approximate equality of the quantiles from several bootstrap samples
Description
Test the approximate equality of the quantiles from several bootstrap samples
Usage
test_conv(bs, probs)
Arguments
bs |
A list of |
probs |
A numeric vector of probabilities with values in [0,1] |
Value
A logical.