The R package mkin provides calculation routines for the analysis of chemical degradation data, including multicompartment kinetics as needed for modelling the formation and decline of transformation products, or if several compartments are involved.
You can install the latest released version from CRAN from within R:
install.packages("mkin")
In the regulatory evaluation of chemical substances like plant protection products (pesticides), biocides and other chemicals, degradation data play an important role. For the evaluation of pesticide degradation experiments, detailed guidance and helpful tools have been developed as detailed in 'Credits and historical remarks' below.
For a start, have a look a the code examples provided for
plot.mkinfit
and
plot.mmkin
, and
at the package vignettes
FOCUS L
and
FOCUS D
.
The HTML documentation is maintained at the R-Forge project site.
mkinmod
,
including equilibrium reactions and using the single first-order
reversible binding (SFORB) model, which will automatically create
two latent state variables for the observed variable.plot.mmkin
.mkinpredict
is performed either using the analytical solution for the case of
parent only degradation, an eigenvalue based solution if only simple
first-order (SFO) or SFORB kinetics are used in the model, or
using a numeric solver from the deSolve
package (default is lsoda
).compiled_models
.
The autogeneration of C code was
inspired by the ccSolve
package. Thanks
to Karline Soetaert for her work on that.transform_odeparms
so their estimators can more reasonably be expected to follow
a normal distribution. This has the side effect that no constraints
are needed in the optimisation. Thanks to René Lehmann for the nice
cooperation on this, especially the isometric logration transformation
that is now used for the formation fractions.summary
of an mkinfit
object is in
fact a full report that should give enough information to be able to
approximately reproduce the fit with other tools.reweight = "obs"
to your call to mkinfit
and a separate variance
componenent for each of the observed variables will be optimised
in a second stage after the primary optimisation algorithm has converged.There is a graphical user interface that I consider useful for real work. Please refer to its documentation page for installation instructions and a manual.
Yes, there is a ChangeLog, for the latest CRAN release and one for the github master branch.
mkin
would not be possible without the underlying software stack consisting
of R and the packages deSolve
and FME, to say the least.
It could not have been written without me being introduced to regulatory fate
modelling of pesticides by Adrian Gurney during my time at Harlan Laboratories
Ltd (formerly RCC Ltd). mkin
greatly profits from and largely follows
the work done by the
FOCUS Degradation Kinetics Workgroup,
as detailed in their guidance document from 2006, slightly updated in 2011 and
2014.
Also, it was inspired by the first version of KinGUI developed by BayerCropScience, which is based on the MatLab runtime environment.
The companion package kinfit (now deprecated) was started in 2008 and first published on CRAN on 01 May 2010.
The first mkin
code was
published on 11 May 2010 and the
first CRAN version
on 18 May 2010.
In 2011, Bayer Crop Science started to distribute an R based successor to KinGUI named
KinGUII whose R code is based on mkin
, but which added, amongst other
refinements, a closed source graphical user interface (GUI), iteratively
reweighted least squares (IRLS) optimisation of the variance for each of the
observed variables, and Markov Chain Monte Carlo (MCMC) simulation
functionality, similar to what is available e.g. in the FME
package.
Somewhat in parallel, Syngenta has sponsored the development of an mkin
and
KinGUII based GUI application called CAKE, which also adds IRLS and MCMC, is
more limited in the model formulation, but puts more weight on usability.
CAKE is available for download from the CAKE
website, where you can also
find a zip archive of the R scripts derived from mkin
, published under the GPL
license.
Finally, there is KineticEval, which contains a further development of the scripts used for KinGUII, so the different tools will hopefully be able to learn from each other in the future as well.
Contributions are welcome! Your mkin fork is just a mouse click away… The master branch on github should always be in good shape, I implement new features in separate branches now. If you prefer subversion, project members for the r-forge project are welcome as well. Generally, the source code of the latest CRAN version should be available there. You can also browse the source code at cgit.jrwb.de/mkin.
Essential functionality
mkinmod
mkinfit
mmkin
Functions working on mkinfit objects
plot.mkinfit
summary.mkinfit
(print.summary.mkinfit)mkinresplot
mkinparplot
endpoints
mkinerrmin
Functions working with aggregated results
[.mmkin
plot.mmkin
FOCUS_2006_datasets
(FOCUS_2006_A, FOCUS_2006_B, FOCUS_2006_C, FOCUS_2006_D, FOCUS_2006_E, FOCUS_2006_F)FOCUS_2006_SFO_ref_A_to_F
FOCUS_2006_FOMC_ref_A_to_F
FOCUS_2006_HS_ref_A_to_F
FOCUS_2006_DFOP_ref_A_to_B
mccall81_245T
schaefer07_complex_case
(schaefer07_complex_results)synthetic_data_for_UBA_2014
mkin_wide_to_long
mkin_long_to_wide
mkinsub
mkinds
print.mkinds
print.mkinmod
mkinpredict
transform_odeparms
(backtransform_odeparms)ilr
(invilr)geometric_mean
Parent only model solutions
SFO.solution
FOMC.solution
DFOP.solution
SFORB.solution
HS.solution
IORE.solution
Functions that have been superseeded
mkinplot