Title: | Web Application for the SSD Module of the MOSAIC Platform |
---|---|
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>. |
Authors: | Milena Kaag [cre, aut], Sandrine Charles [aut] , UMR5558 LBBE MEPS [cph, fnd], rhandsontable contributors [ctb, cph] (For my_rhandsontable function) |
Maintainer: | Milena Kaag <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.1 |
Built: | 2024-12-15 07:40:00 UTC |
Source: | CRAN |
Add confidence interval(s) to an existing fitted distribution ggplot
add_CI_plot(base_plot, bts, logscale, CI.level = 0.95)
add_CI_plot(base_plot, bts, logscale, CI.level = 0.95)
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). |
A ggplot object.
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.
base_cdf(fits, unit, logscale, names = NULL, horizontals = TRUE, xlim = NULL)
base_cdf(fits, unit, logscale, names = NULL, horizontals = TRUE, xlim = NULL)
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 |
A ggplot object.
Determines the appropriate bootstrap function based on a fit object
bootdist_fun(x, ft, niter = 200)
bootdist_fun(x, ft, niter = 200)
x |
Not used |
ft |
A |
niter |
An integer. The number of iterations set for the bootstrap function |
An appropriate bootstrap function.
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.
cens_lines_plot( data, unit, logscale, fits = NULL, leftNA = 0, rightNA = Inf, color_group = FALSE )
cens_lines_plot( data, unit, logscale, fits = NULL, leftNA = 0, rightNA = Inf, color_group = FALSE )
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 |
A ggplot object.
Generate a script according to user in-app inputs
code_r_ssd( data, distributions, censored = FALSE, logscale = TRUE, unit = "arbitrary unit", names = FALSE, groups = FALSE, CI.level = 0.95 )
code_r_ssd( data, distributions, censored = FALSE, logscale = TRUE, unit = "arbitrary unit", names = FALSE, groups = FALSE, CI.level = 0.95 )
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 |
A character string containing a R script.
bootdist
or
bootdistcens
objectCombine several bootstrap samples into a single bootdist
or
bootdistcens
object
combine_boot_samples(bs)
combine_boot_samples(bs)
bs |
A list of |
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.
theme_bw
Custom ggplot theme created for MOSAIC bioacc overwriting theme_bw
custom_theme()
custom_theme()
Summary of 48 to 96-hour acute toxicity values (LC50 and EC50 values) for exposure of Australian and Non-Australian taxa to endosulfan.
endosulfan
endosulfan
endosulfan
A data frame with 88 rows and 3 columns:
Lethal or effective concentration in g/L.
Specie's name for each concentration.
Classification by geographical origin and type: fish or arthropod.
https://pubmed.ncbi.nlm.nih.gov/15499502/
48-hour acute toxicity values (EC50 values) for exposure of macroinvertebrates and zooplancton to fluazinam.
fluazinam
fluazinam
fluazinam
A data frame with 14 rows and 4 columns:
Lower & higher bounds of the effective concentration
interval in g/L.
Specie's name for each effective concentration.
Classification of the specie, not all rows use the same taxonomic rank.
https://pubmed.ncbi.nlm.nih.gov/19837458/
Generate bootstrap sample(s) for a list of fit(s) and check their convergence
get_bootstrap(fits)
get_bootstrap(fits)
fits |
A list of |
A list of two lists. The first list contains the bootstrap sample(s) and the second one the logical value of convergence.
Fit the specified distributions to the given data
get_fits(data, distributions, censored)
get_fits(data, distributions, censored)
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 |
A list containing the fit object(s) of class fitdist
or
fitdistcens
.
Get HC5, HC10, HC20 and HC50 for each fit provided, with confidence intervals if the corresponding bootstraps were provided.
get_HCx_table(fits, distributions, bootstrap = NULL, CI.level = 0.95)
get_HCx_table(fits, distributions, bootstrap = NULL, CI.level = 0.95)
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). |
A data.frame with different HCx as rows and different fits as columns.
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.
get_parameters_html(fits = NULL, bootstrap = NULL, CI.level = 0.95)
get_parameters_html(fits = NULL, bootstrap = NULL, CI.level = 0.95)
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). |
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 ]
A character string with HTML formatting.
Create a label for x axis based on concentration unit and log scale
get_xlab(unit, logscale)
get_xlab(unit, logscale)
unit |
A character vector, the unit of the toxicity data |
logscale |
if |
A character vector.
Create an empirical cdf representation colored according to a "group" attribute. The fitted distribution is also represented.
group_cdf_censored(fits, unit, logscale, data)
group_cdf_censored(fits, unit, logscale, data)
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 |
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()
.
A ggplot object.
Add a group coloration to a provided empirical cdf representation according to a "group" column in data.
group_cdf_uncensored(data, p)
group_cdf_uncensored(data, p)
data |
A data.frame with columns |
p |
a ggplot object showing the empirical cumulative distribution function of the uncensored data provided. |
A ggplot object.
Create a pretty confidence interval ggplot
my_CIcdfplot(b, logscale, CI.level)
my_CIcdfplot(b, logscale, CI.level)
b |
One |
logscale |
if |
CI.level |
A strictly positive numeric smaller than 1. The level of the confidence interval(s). |
A ggplot with 7 or 8 layers.
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.
Add names to a provided empirical cumulative distribution function ggplot (i.e.,species names).
name_plot_censored(data, p, leftNA = 0, rightNA = Inf)
name_plot_censored(data, p, leftNA = 0, rightNA = Inf)
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. |
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.
A ggplot object.
Create an empirical cumulative distribution function ggplot with a name (i.e. species names) associated to each observation.
name_plot_uncensored(fits, unit, logscale, data, horizontals = TRUE)
name_plot_uncensored(fits, unit, logscale, data, horizontals = TRUE)
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 |
A ggplot object.
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.
options_plot( fits, unit, logscale, data, use_names = FALSE, use_groups = FALSE, horizontals = TRUE, lines_display = TRUE )
options_plot( fits, unit, logscale, data, use_names = FALSE, use_groups = FALSE, horizontals = TRUE, lines_display = TRUE )
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 |
A ggplot object.
fitdistrplus
plotsTake a data.frame of censored toxicity data and order them like
fitdistrplus
plots
order_cens_data(data)
order_cens_data(data)
data |
A data.frame of censored data with columns |
A data.frame with ordered toxicity values.
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.
Run the Shiny Application
run_app( onStart = NULL, options = list(), enableBookmarking = NULL, uiPattern = "/", ... )
run_app( onStart = NULL, options = list(), enableBookmarking = NULL, uiPattern = "/", ... )
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. |
No return value, called for side effects
72-hour acute salinity tolerance (LC50 values) of riverine macro-invertebrates grouped by taxonomic family.
salinity_family
salinity_family
Salinity_order
A data frame with 108 rows and 3 columns:
Lower & higher bounds of the lethal concentration
interval in mS/cm.
Family of each tested specie.
https://cdnsciencepub.com/doi/abs/10.1139/f06-080
72-hour acute salinity tolerance (LC50 values) of riverine macro-invertebrates grouped by taxonomic order.
salinity_order
salinity_order
Salinity_order
A data frame with 108 rows and 3 columns:
Lower & higher bounds of the lethal concentration
interval in mS/cm.
Order of each tested specie.
https://cdnsciencepub.com/doi/abs/10.1139/f06-080
Custom toggle switch input for shiny UI
switchInput(id, aria_label, checked = TRUE)
switchInput(id, aria_label, checked = TRUE)
id |
The |
aria_label |
An invisible label for screen readers. |
checked |
Whether to create the switch as ON. |
A toggle switch control that can be added to a UI definition.
Test the approximate equality of the quantiles from several bootstrap samples
test_conv(bs, probs)
test_conv(bs, probs)
bs |
A list of |
probs |
A numeric vector of probabilities with values in [0,1] |
A logical.