| Title: | Inference and Prediction of Toxicokinetic Models |
| Version: | 1.3.1 |
| Description: | Provides bioaccumulation factors from a toxicokinetic model fitted to accumulation-depuration data. It is designed to fulfil the requirements of regulators when examining applications for market authorization of active substances. |
| URL: | https://gitlab.in2p3.fr/mosaic-software/rbioacc |
| BugReports: | https://gitlab.in2p3.fr/mosaic-software/rbioacc/-/issues |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| LazyData: | true |
| RoxygenNote: | 7.3.2 |
| Biarch: | true |
| Depends: | R (≥ 3.5.0) |
| Imports: | ggplot2, methods, Rcpp, rstan (≥ 2.26.0), rstantools (≥ 2.1.1), ggmcmc, GGally, loo, stringr, stats, zoo |
| LinkingTo: | BH (≥ 1.66.0), Rcpp, RcppEigen (≥ 0.3.3.3.0), RcppParallel (≥ 5.0.1), rstan (≥ 2.26.0), StanHeaders (≥ 2.26.0) |
| SystemRequirements: | GNU make |
| Config/testthat/edition: | 3 |
| Suggests: | knitr, rmarkdown, testthat |
| VignetteBuilder: | knitr |
| NeedsCompilation: | yes |
| Packaged: | 2025-09-26 09:05:31 UTC; virgile |
| Author: | Virgile Baudrot [aut, cre], Sandrine Charles [aut], Ophélia Gestin [ctb], Miléna Kaag [aut], Christelle Lopes [ctb], Gauthier Multari [ctb], Alain Pavé [ctb], Aude Ratier [aut], Aurélie Siberchicot [aut] |
| Maintainer: | Virgile Baudrot <virgile.baudrot@qonfluens.com> |
| Repository: | CRAN |
| Date/Publication: | 2025-09-26 09:40:02 UTC |
The 'rbioacc' package.
Description
A DESCRIPTION OF THE PACKAGE
Author(s)
Maintainer: Virgile Baudrot virgile.baudrot@qonfluens.com
Authors:
Sandrine Charles
Miléna Kaag
Aude Ratier
Aurélie Siberchicot
Other contributors:
Ophélia Gestin [contributor]
Christelle Lopes [contributor]
Gauthier Multari [contributor]
Alain Pavé [contributor]
References
Stan Development Team (NA). RStan: the R interface to Stan. R package version NA. https://mc-stan.org
See Also
Useful links:
Report bugs at https://gitlab.in2p3.fr/mosaic-software/rbioacc/-/issues
A simple implementation of to pivot_longer of tidyr
Description
A simple implementation of to pivot_longer of tidyr
Usage
.fonte(df, names_to, values_to)
Arguments
df |
A data frame to pivot. |
names_to |
A string specifying the name of the column to create from
the data stored in the column names of |
values_to |
A string specifying the name of the column to create from the data stored in cell values. |
Value
The data frame with a "lengthens" shape: more rows, less columns
Return column matching "expw", "exps", "expf", "exppw" of a data.frame
Description
Return column matching "expw", "exps", "expf", "exppw" of a data.frame
Usage
.index_col_exposure(data_frame)
Arguments
data_frame |
a dataframe |
Value
A vector of numeric
Return column matching "concX" of a data.frame where X is metabolite
Description
Return column matching "concX" of a data.frame where X is metabolite
Usage
.index_col_metabolite(data_frame)
Arguments
data_frame |
a dataframe |
Value
A vector of numeric
Check if two vectors x and y are equal after remove Inf
Description
Check if two vectors x and y are equal after remove Inf
Usage
.is_equal_rmInf(x, y)
Arguments
x |
A vector |
y |
A vector |
Value
A logical value
Data on Chironomus with several exposure routes.
Description
Data on Chironomus with several exposure routes.
Usage
data(Chiro_Creuzot)
Format
A dataframe with 24 observations on the following four variables:
timeA vector of class
numericwith the time points in days.expwA vector of class
numericwith the exposure in water.expwA vector of class
numericwith the exposure in pore water.replicateA vector of class
integerfor replicate identification.concA vector of class
numericwith concentration in organism.concm1A vector of class
numericwith metabolite concentration in organism.concm2A vector of class
numericwith metabolite concentration in organism.
Data on Chironomus exposed to benzoapyrene
Description
Data on Chironomus exposed to benzoapyrene
Usage
data(Chironomus_benzoapyrene)
Data on Sialis lutaria exposure time series
Description
Data on Sialis lutaria exposure time series
Usage
data(Exposure_Sialis_lutaria)
Data on Gammarus exposed to azoxistrobine
Description
Data on Gammarus exposed to azoxistrobine
Usage
data(Gammarus_azoxistrobine_1d_Rosch2017)
Data on Sialis lutaria internal time series
Description
Data on Sialis lutaria internal time series
Usage
data(Internal_Sialis_lutaria)
Male Gammarus fossarum exposed to Hg spiked water.
Three exposure concentrations were tested in triplicates. The duration of the
accumulation phase is 4 days for 0.0000708021 and 0.000283208
\mu g.m L^{-1} exposure concentrations, and 7 days for 0.000141604
\mu g.m L^{-1} exposure concentration.
Description
Male Gammarus fossarum exposed to Hg spiked water.
Three exposure concentrations were tested in triplicates. The duration of the
accumulation phase is 4 days for 0.0000708021 and 0.000283208
\mu g.m L^{-1} exposure concentrations, and 7 days for 0.000141604
\mu g.m L^{-1} exposure concentration.
Usage
data(Male_Gammarus_Merged)
Format
A dataframe with 72 observations on the following four variables:
timeA vector of class
numericwith the time points in days.expwA vector of class
numericwith Hg exposure in water in\mu g.m L^{-1}.replicateA vector of class
integerfor replicate identification.concA vector of class
numericwith Hg concentration in organism in\mu g.m L^{-1}.
References
Ciccia, T. (2019). Accumulation et devenir du mercure chez l'espèce sentinelle Gammarus fossarum : de l'expérimentation au développement d'un modèle toxicocinétique multi-compartiments. Rapport de stage de Master 2, INRAE.
Bio-accumulation data set for Gammarus fossarum exposed to Hg spiked water.
Description
Male Gammarus fossarum exposed to Hg spiked water. A single exposure concentration was tested. The duration of the accumulation phase is 4 days.
Usage
data(Male_Gammarus_Single)
Format
A dataframe with 23 observations on the following four variables:
timeA vector of class
numericwith the time points in days.expwA vector of class
numericwith Hg exposure in water in\mu g.m L^{-1}.replicateA vector of class
integerfor replicate identification.concA vector of class
numericwith Hg concentration in organism in\mu g.m L^{-1}.
References
Ciccia, T. (2019). Accumulation et devenir du mercure chez l'espèce sentinelle Gammarus fossarum : de l'expérimentation au développement d'un modèle toxicocinétique multi-compartiments. Rapport de stage de Master 2, INRAE.
Male Gammarus pulex exposed to seanine spiked water. A single exposure
concentration was tested. The duration of the accumulation phase is 1.417
days. Three metabolites were quantified. The growth of organism was included.
Description
Male Gammarus pulex exposed to seanine spiked water. A single exposure
concentration was tested. The duration of the accumulation phase is 1.417
days. Three metabolites were quantified. The growth of organism was included.
Usage
data(Male_Gammarus_seanine_growth)
Format
A dataframe with 22 observations on the following four variables:
timeA vector of class
numericwith the time points in days.expwA vector of class
numericwith seanine exposure in water in\mu g.m L^{-1}.replicateA vector of class
integerfor replicate identification.concA vector of class
numericwith concentration in organism.concm1A vector of class
numericwith metabolite concentration in organism.concm2A vector of class
numericwith metabolite concentration in organism.concm3A vector of class
numericwith metabolite concentration in organism.growthA vector of class
numericwith growth of the organism.
References
Ashauer, R. et al. (2012). Significance of xenobiotic metabolism for bioaccumulation kinetics of organic chemicals in Gammarus pulex. Environmental Science Technology, 46: 3498-3508.
Data on Oncorhynchus exposition
Description
Data on Oncorhynchus exposition
Usage
data(Oncorhynchus_two)
Biaccumulation metrics
Description
Biaccumulation metrics
Usage
bioacc_metric(fit, ...)
## S3 method for class 'fitTK'
bioacc_metric(fit, type = "k", route = "all", ...)
Arguments
fit |
An |
... |
Further arguments to be passed to generic methods |
type |
A string with the type of metric: |
route |
Provide exposure route: |
Value
a data frame
Correlations between parameters: colored matrix
Description
Correlations between parameters: colored matrix
Usage
corrMatrix(fit)
Arguments
fit |
An object of class |
Value
A heatmap of class ggplot.
Correlations between parameters: pairs plot
Description
Correlations between parameters: pairs plot
Usage
corrPlot(fit, plots = c("all", "deterministic", "stochastic"))
Arguments
fit |
An object of class |
plots |
A string selecting the parameters. Defaults is |
Value
A pairsplot of class ggmatrix containing planes of parameter pairs (lower triangle), marginal posterior distribution of each parameter (diagonal) and Pearson correlation coefficients (upper triangle)
Data frame of Posterior over Prior
Description
Data frame of Posterior over Prior
Data frame of Posterior over Prior
Usage
df_PriorPost(fit, ...)
## S3 method for class 'fitTK'
df_PriorPost(fit, select = "all", ...)
Arguments
fit |
An object of class |
... |
Additional arguments |
select |
A string selecting the parameters. Defaults is |
Value
An object of class data.frame
PPC data.frame
Description
This is the generic ppc S3 method for plots of the predicted
values along with 95\
versus the observed values for fitTK objects.
Usage
df_ppc(fit, ...)
## S3 method for class 'fitTK'
df_ppc(fit, ...)
ppc(fit, ...)
## S3 method for class 'fitTK'
ppc(fit, ...)
Arguments
fit |
And object returned by fitTK |
... |
Additional arguments |
Details
The black points show the observed number of survivors (pooled
replicates, on X-axis) against the corresponding predicted
number (Y-axis). Predictions come along with 95\
intervals, which are depicted in green when they contain the
observed value and in red otherwise. Samples with equal observed
value are shifted on the X-axis. For that reason, the
bisecting line (y = x), is represented by steps when observed
values are low. That way we ensure green intervals do intersect the
bisecting line.
Value
A data frame with median and 95\
a plot of class ggplot
Equations of the mathematical model used for the fit
Description
Equations of the mathematical model used for the fit
Usage
equations(fit, object)
Arguments
fit |
An object of class |
object |
The data.frame used as the base as the fit object |
Value
A vector of strings each containing an equation
Retrieve exposure routes names from object
Description
Retrieve exposure routes names from object
Usage
exposure_names(object)
Arguments
object |
a data frame. |
Value
A vector of string
Posterior predictive check
Description
Posterior predictive check
Bayesian inference of TK model with Stan
Bayesian inference of TK model with variable exposure profile (BETA version)
Usage
fitTK(stanTKdata, ...)
## S3 method for class 'stanTKdataCST'
fitTK(stanTKdata, ...)
## S3 method for class 'stanTKdataVAR'
fitTK(stanTKdata, ...)
Arguments
stanTKdata |
List of Data require for computing |
... |
Arguments passed to |
Value
An object of class fitTK containing two object: stanTKdata
the data set used for inference and stanfit returned by rstan::sampling
Traces of MCMC iterations
Description
Traces of MCMC iterations
Usage
mcmcTraces(fit, plots = "all")
Arguments
fit |
An object of class |
plots |
A string selecting the parameters. Defaults is |
Value
A traceplot of class ggplot.
Create a list giving data and parameters to use in the model inference.
Description
Create a list giving data and parameters to use in the model inference.
Usage
modelData(object, ...)
## S3 method for class 'data.frame'
modelData(object, time_accumulation, elimination_rate = NA, ...)
Arguments
object |
An object of class |
... |
Further arguments to be passed to generic methods |
time_accumulation |
A scalar givin accumulation time |
elimination_rate |
A scalar for the elimination rate. Default is |
Value
A list with data and parameters require for model inference.
Create a list giving data and parameters to use in the model inference.
Description
Create a list giving data and parameters to use in the model inference.
Usage
modelData_ode(
df_exposure,
df_internal,
y0 = 1,
t0 = -0.001,
unifMax = 10,
time_accumulation = NULL,
minK = -5,
maxK = 5,
...
)
modelData_ode(
df_exposure,
df_internal,
y0 = 1,
t0 = -0.001,
unifMax = 10,
time_accumulation = NULL,
minK = -5,
maxK = 5,
...
)
Arguments
df_exposure |
Dataframe of exposure with 2 column ( |
df_internal |
Dataframe of internal concentration with 2 column ( |
y0 |
Initial concentration |
t0 |
initial time point |
unifMax |
Hyperparameter value |
time_accumulation |
Time of accumulation |
minK |
Hyperparameter value |
maxK |
Hyperparameter value |
... |
Additional arguments |
Value
A list with data and parameters require for model inference.
Plot function for object of class bioaccMetric
Description
Plot function for object of class bioaccMetric
Usage
## S3 method for class 'bioaccMetric'
plot(x, ...)
Arguments
x |
a data frame |
... |
Additional arguments |
Value
A plot of class ggplot
Plotting method for fitTK objects
Description
This is the generic plot S3 method for the
fitTK. It plots the fit obtained for each
variable in the original dataset.
Usage
## S3 method for class 'fitTK'
plot(x, time_interp = NULL, ...)
Arguments
x |
And object returned by fitTK |
time_interp |
A vector with additional time point to interpolate. Time point of the original data set are conserved. |
... |
Additional arguments |
Value
a plot of class ggplot
Plotting method for predictTK objects
Description
This is the generic plot S3 method for the
predictTK.
Usage
## S3 method for class 'predictTK'
plot(x, ...)
## S3 method for class 'predictTKstan'
plot(x, add_data = FALSE, ...)
Arguments
x |
An object of class |
... |
Additional arguments |
add_data |
logical TRUE or FALSE to add the orignal data of the fit object
|
Value
A plot of class ggplot
Plot Posterior over Prior
Description
Plot Posterior over Prior
Plot Posterior over Prior
Usage
plot_PriorPost(x, ...)
## S3 method for class 'fitTK'
plot_PriorPost(x, select = "all", ...)
## S3 method for class 'df_PP'
plot_PriorPost(x, select = "all", ...)
Arguments
x |
A data.frame of class |
... |
addition arguments |
select |
A string selecting the parameters. Defaults is |
Value
A plot of class ggplot.
A plot of class ggplot.
Plot exposure profile
Description
Plot exposure profile
Usage
plot_exposure(object)
Arguments
object |
a data frame with exposure column |
Value
a plot of class ggplot
Prediction function using fitTK object
Description
Use when parameter are manually given by the user.
Usage
## S3 method for class 'fitTK'
predict(object, data, mcmc_size = NULL, fixed_init = TRUE, ...)
predict_stan(
object,
data,
mcmc_size = NULL,
fixed_init = TRUE,
time_interp = NULL,
iter = 1000,
...
)
predict_manual(
param,
data,
time_accumulation = NULL,
C0 = 0,
G0 = NA,
gmax = NA
)
Arguments
object |
An object of |
data |
A data set with one column |
mcmc_size |
Size of mcmc chain if needed to be reduced |
fixed_init |
If |
... |
Additional arguments |
time_interp |
A vector with additional time point to interpolate. Time point of the original data set are conserved. |
iter |
Number of time steps |
param |
A dataframe with name of parameters |
time_accumulation |
the time of accumulation. |
C0 |
Gives the initial conditions of internal concentration. |
G0 |
initial condition of G0 (require if |
gmax |
gmax (require if |
Value
An object of class predictTK
An object of class predictTK
Potential Scale Reduction Factors (PSRF) of the parameters
Description
Potential Scale Reduction Factors (PSRF) of the parameters
Usage
psrf(fit)
Arguments
fit |
An object of class |
Value
An object of class data.frame with two columns: PSRF and parameter
a data frame with Potential Scale Reduction Factors
Quantiles of parameters
Description
Quantiles of parameters
Usage
quantile_table(fit, probs = c(0.025, 0.5, 0.975))
Arguments
fit |
An object of class |
probs |
Scalar or Vector of quantiles. Default is 0.025, 0.5 and 0.975 giving median and 95% credible interval |
Value
A data frame with quantiles
Replace element of a vector
Description
Replace element of a vector
Usage
replace_(x, from, to)
Arguments
x |
a vector |
from |
a vector of elements to replace |
to |
a vector with replacing elements |
Value
a vector
Examples
replace_(1:10,c(2,4,5,8), c(0,0,0,0))
replace_(c(1,2,2,3,2),c(3,2), c(4,5))
remove message and warning
Description
Remove message and warning which is usefull when running a model and removing all outputs messages and warnings#'
Usage
rmMessWarn(...)
Arguments
... |
any function, but a fit function. |
Return the time at 95% depuration of the parent component
Description
Return the time at 95% depuration of the parent component
Usage
t95(fit)
Arguments
fit |
An object of class |
Value
a numeric object
Widely Applicable Information Criterion (WAIC)
Description
Compute WAIC using the waic() method of the loo package.
Usage
waic(fit)
Arguments
fit |
An object of class |
Value
A numeric containing the WAIC