<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Index. mkin 0.9.43.9000</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="">
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link href="css/highlight.css" rel="stylesheet">
<link href="css/staticdocs.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true
}
});
</script>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
</head>
<body>
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="#">mkin 0.9.43.9000</a>
<div class="nav">
<ul class="nav">
<li><a href="index.html"><i class="icon-home icon-white"></i> Index</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<header>
</header>
<div class="row">
<div class="span8">
<h1>mkin</h1>
<p><a href="http://cran.r-project.org/package=mkin"><img src="http://www.r-pkg.org/badges/version/mkin" alt=""/></a></p>
<p>The R package <strong>mkin</strong> provides calculation routines for the analysis of
chemical degradation data, including <b>m</b>ulticompartment <b>kin</b>etics as
needed for modelling the formation and decline of transformation products, or
if several compartments are involved.</p>
<h2>Installation</h2>
<p>You can install the latest released version from
<a href="http://cran.r-project.org/package=mkin">CRAN</a> from within R:</p>
<pre><code class="r">install.packages("mkin")
</code></pre>
<h2>Background</h2>
<p>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.</p>
<h2>Usage</h2>
<p>For a start, have a look a the code examples provided for
<a href="http://kinfit.r-forge.r-project.org/mkin_static/plot.mkinfit.html"><code>plot.mkinfit</code></a>
and
<a href="http://kinfit.r-forge.r-project.org/mkin_static/plot.mmkin.html"><code>plot.mmkin</code></a>, and
at the package vignettes
<a href="http://kinfit.r-forge.r-project.org/mkin_static/vignettes/FOCUS_L.html"><code>FOCUS L</code></a> and
<a href="http://kinfit.r-forge.r-project.org/mkin_static/vignettes/FOCUS_D.html"><code>FOCUS D</code></a>.</p>
<h2>Documentation</h2>
<p>The <a href="http://kinfit.r-forge.r-project.org/mkin_static">HTML documentation</a> is
maintained at the R-Forge project site.</p>
<h2>Features</h2>
<ul>
<li>Highly flexible model specification using
<a href="http://kinfit.r-forge.r-project.org/mkin_static/mkinmod.html"><code>mkinmod</code></a>,
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.</li>
<li>As of version 0.9-39, fitting of several models to several datasets, optionally in
parallel, is supported, see for example
<a href="http://kinfit.r-forge.r-project.org/mkin_static/plot.mmkin.html"><code>plot.mmkin</code></a>.</li>
<li>Model solution (forward modelling) in the function
<a href="http://kinfit.r-forge.r-project.org/mkin_static/mkinpredict.html"><code>mkinpredict</code></a>
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 <code>deSolve</code> package (default is <code>lsoda</code>).</li>
<li>If a C compiler is installed, the kinetic models are compiled from automatically
generated C code, see<br/>
<a href="http://kinfit.r-forge.r-project.org/mkin_static/vignettes/compiled_models.html">vignette <code>compiled_models</code></a>.
The autogeneration of C code was
inspired by the <a href="https://github.com/karlines/ccSolve"><code>ccSolve</code></a> package. Thanks
to Karline Soetaert for her work on that.</li>
<li>By default, kinetic rate constants and kinetic formation fractions are
transformed internally using
<a href="http://kinfit.r-forge.r-project.org/mkin_static/transform_odeparms.html"><code>transform_odeparms</code></a>
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.</li>
<li>A side effect of this is that when parameter estimates are backtransformed
to match the model definition, confidence intervals calculated from
standard errors are also backtransformed to the correct scale, and will
not include meaningless values like negative rate constants or
formation fractions adding up to more than 1, which can not occur in
a single experiment with a single defined radiolabel position.</li>
<li>The usual one-sided t-test for significant difference from zero is nevertheless
shown based on estimators for the untransformed parameters.</li>
<li>Summary and plotting functions. The <code>summary</code> of an <code>mkinfit</code> object is in
fact a full report that should give enough information to be able to
approximately reproduce the fit with other tools.</li>
<li>The chi-squared error level as defined in the FOCUS kinetics guidance
(see below) is calculated for each observed variable.</li>
<li>Iteratively reweighted least squares fitting is implemented in a similar way
as in KinGUII and CAKE (see below). Simply add the argument
<code>reweight = "obs"</code> to your call to <code>mkinfit</code> 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.</li>
<li>When a metabolite decline phase is not described well by SFO kinetics,
SFORB kinetics can be used for the metabolite.</li>
</ul>
<h2>GUI</h2>
<p>There is a graphical user interface that I consider useful for real work. Please
refer to its <a href="http://kinfit.r-forge.r-project.org/gmkin_static">documentation page</a>
for installation instructions and a manual.</p>
<h2>News</h2>
<p>Yes, there is a ChangeLog, for the latest <a href="http://cran.r-project.org/web/packages/mkin/news.html">CRAN release</a>
and one for the <a href="https://github.com/jranke/mkin/blob/master/NEWS.md">github master branch</a>.</p>
<h2>Credits and historical remarks</h2>
<p><code>mkin</code> would not be possible without the underlying software stack consisting
of R and the packages <a href="http://cran.r-project.org/package=deSolve">deSolve</a>
and <a href="http://cran.r-project.org/package=FME">FME</a>, to say the least.</p>
<p>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). <code>mkin</code> greatly profits from and largely follows
the work done by the
<a href="http://focus.jrc.ec.europa.eu/dk">FOCUS Degradation Kinetics Workgroup</a>,
as detailed in their guidance document from 2006, slightly updated in 2011 and
2014.</p>
<p>Also, it was inspired by the first version of KinGUI developed by
BayerCropScience, which is based on the MatLab runtime environment.</p>
<p>The companion package
<a href="http://kinfit.r-forge.r-project.org/kinfit_static/index.html">kinfit</a> (now deprecated) was
<a href="https://r-forge.r-project.org/scm/viewvc.php?view=rev&root=kinfit&revision=2">started in 2008</a> and
<a href="http://cran.r-project.org/src/contrib/Archive/kinfit/">first published</a> on
CRAN on 01 May 2010.</p>
<p>The first <code>mkin</code> code was
<a href="https://r-forge.r-project.org/scm/viewvc.php?view=rev&root=kinfit&revision=8">published on 11 May 2010</a> and the
<a href="http://cran.r-project.org/src/contrib/Archive/mkin">first CRAN version</a>
on 18 May 2010.</p>
<p>In 2011, Bayer Crop Science started to distribute an R based successor to KinGUI named
KinGUII whose R code is based on <code>mkin</code>, 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 <code>FME</code> package.</p>
<p>Somewhat in parallel, Syngenta has sponsored the development of an <code>mkin</code> 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 <a href="http://projects.tessella.com/cake">CAKE
website</a>, where you can also
find a zip archive of the R scripts derived from <code>mkin</code>, published under the GPL
license.</p>
<p>Finally, there is
<a href="http://github.com/zhenglei-gao/KineticEval">KineticEval</a>, 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.</p>
<h2>Development</h2>
<p>Contributions are welcome! Your
<a href="https://help.github.com/articles/fork-a-repo">mkin fork</a> 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
<a href="http://r-forge.r-project.org/R/?group_id=615">r-forge project</a> 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 <a href="http://cgit.jrwb.de/mkin">cgit.jrwb.de/mkin</a>.</p>
<h2>Help topics</h2>
<h3>Main functions</h3>
<p>Essential functionality</p>
<ul class="index">
<li>
<code><a href="mkinmod.html">mkinmod</a></code><br /> Function to set up a kinetic model with one or more state variables
</li>
<li>
<code><a href="mkinfit.html">mkinfit</a></code><br /> Fit a kinetic model to data with one or more state variables
</li>
<li>
<code><a href="mmkin.html">mmkin</a></code><br /> Fit one or more kinetic models with one or more state variables to one or more datasets
</li>
</ul>
<h3>Show results</h3>
<p>Functions working on mkinfit objects</p>
<ul class="index">
<li>
<code><a href="plot.mkinfit.html">plot.mkinfit</a></code>(plot_sep)<br /> Plot the observed data and the fitted model of an mkinfit object
</li>
<li>
<code><a href="summary.mkinfit.html">summary.mkinfit</a></code>(print.summary.mkinfit)<br /> Summary method for class "mkinfit"
</li>
<li>
<code><a href="mkinresplot.html">mkinresplot</a></code><br /> Function to plot residuals stored in an mkin object
</li>
<li>
<code><a href="mkinparplot.html">mkinparplot</a></code><br /> Function to plot the confidence intervals obtained using
</li>
<li>
<code><a href="endpoints.html">endpoints</a></code><br />Function to calculate endpoints for further use from kinetic models fitted with mkinfit
</li>
<li>
<code><a href="mkinerrmin.html">mkinerrmin</a></code><br />Calculate the minimum error to assume in order to pass the variance test
</li>
</ul>
<h3>Work with mmkin objects</h3>
<p>Functions working with aggregated results</p>
<ul class="index">
<li>
<code><a href="Extract.mmkin.html">[.mmkin</a></code><br />Subsetting method for mmkin objects</li>
<li>
<code><a href="plot.mmkin.html">plot.mmkin</a></code><br /> Plot model fits (observed and fitted) and the residuals for a row or column of an mmkin object
</li>
</ul>
<h3>Datasets and known results</h3>
<ul class="index">
<li>
<code><a href="FOCUS_2006_datasets.html">FOCUS_2006_datasets</a></code>(FOCUS_2006_A, FOCUS_2006_B, FOCUS_2006_C, FOCUS_2006_D, FOCUS_2006_E, FOCUS_2006_F)<br />Datasets A to F from the FOCUS Kinetics report from 2006
</li>
<li>
<code><a href="FOCUS_2006_SFO_ref_A_to_F.html">FOCUS_2006_SFO_ref_A_to_F</a></code><br />Results of fitting the SFO model to Datasets A to F of FOCUS (2006)
</li>
<li>
<code><a href="FOCUS_2006_FOMC_ref_A_to_F.html">FOCUS_2006_FOMC_ref_A_to_F</a></code><br />Results of fitting the FOMC model to Datasets A to F of FOCUS (2006)
</li>
<li>
<code><a href="FOCUS_2006_HS_ref_A_to_F.html">FOCUS_2006_HS_ref_A_to_F</a></code><br />Results of fitting the HS model to Datasets A to F of FOCUS (2006)
</li>
<li>
<code><a href="FOCUS_2006_DFOP_ref_A_to_B.html">FOCUS_2006_DFOP_ref_A_to_B</a></code><br />Results of fitting the DFOP model to Datasets A to B of FOCUS (2006)
</li>
<li>
<code><a href="mccall81_245T.html">mccall81_245T</a></code><br /> Datasets on aerobic soil metabolism of 2,4,5-T in six soils
</li>
<li>
<code><a href="schaefer07_complex_case.html">schaefer07_complex_case</a></code>(schaefer07_complex_results)<br /> Metabolism data set used for checking the software quality of KinGUI
</li>
<li>
<code><a href="synthetic_data_for_UBA.html">synthetic_data_for_UBA_2014</a></code><br /> Synthetic datasets for one parent compound with two metabolites
</li>
</ul>
<h3>Helper functions</h3>
<ul class="index">
<li>
<code><a href="mkin_wide_to_long.html">mkin_wide_to_long</a></code><br /> Convert a dataframe with observations over time into long format
</li>
<li>
<code><a href="mkin_long_to_wide.html">mkin_long_to_wide</a></code><br /> Convert a dataframe from long to wide format
</li>
<li>
<code><a href="mkinsub.html">mkinsub</a></code><br /> Function to set up a kinetic submodel for one state variable
</li>
<li>
<code><a href="mkinds.html">mkinds</a></code><br />A dataset class for mkin</li>
<li>
<code><a href="print.mkinds.html">print.mkinds</a></code><br /> Print mkinds objects
</li>
<li>
<code><a href="print.mkinmod.html">print.mkinmod</a></code><br /> Print mkinmod objects
</li>
<li>
<code><a href="mkinpredict.html">mkinpredict</a></code><br /> Produce predictions from a kinetic model using specific parameters
</li>
<li>
<code><a href="transform_odeparms.html">transform_odeparms</a></code>(backtransform_odeparms)<br /> Functions to transform and backtransform kinetic parameters for fitting
</li>
<li>
<code><a href="ilr.html">ilr</a></code>(invilr)<br /> Function to perform isometric log-ratio transformation
</li>
<li>
<code><a href="geometric_mean.html">geometric_mean</a></code><br /> Calculate the geometric mean </li>
</ul>
<h3>Analytical solutions</h3>
<p>Parent only model solutions</p>
<ul class="index">
<li>
<code><a href="SFO.solution.html">SFO.solution</a></code><br /> Single First-Order kinetics </li>
<li>
<code><a href="FOMC.solution.html">FOMC.solution</a></code><br /> First-Order Multi-Compartment kinetics </li>
<li>
<code><a href="DFOP.solution.html">DFOP.solution</a></code><br />Double First-Order in Parallel kinetics
</li>
<li>
<code><a href="SFORB.solution.html">SFORB.solution</a></code><br /> Single First-Order Reversible Binding kinetics </li>
<li>
<code><a href="HS.solution.html">HS.solution</a></code><br /> Hockey-Stick kinetics </li>
<li>
<code><a href="IORE.solution.html">IORE.solution</a></code><br /> Indeterminate order rate equation kinetics </li>
</ul>
<h3>Deprecated functions</h3>
<p>Functions that have been superseeded</p>
<ul class="index">
<li>
<code><a href="mkinplot.html">mkinplot</a></code><br /> Plot the observed data and the fitted model of an mkinfit object
</li>
</ul>
<h3>Other</h3>
<ul class="index">
<li>
<code><a href="add_err.html">add_err</a></code><br /> Add normally distributed errors to simulated kinetic degradation data
</li>
</ul>
</div>
<div class="span3 offset1">
<h2>Vignettes</h2>
<ul>
<li><a href="vignettes/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a></li>
<li><a href="vignettes/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a></li>
<li><a href="vignettes/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a></li>
<li><a href="vignettes/mkin.html">mkin - Kinetic evaluation of chemical degradation data</a></li>
<li><a href="vignettes/FOCUS_Z.pdf">Example evaluation of FOCUS dataset Z</a></li>
</ul>
<h2>Dependencies</h2>
<ul>
<li><strong>Depends</strong>: minpack.lm, rootSolve, inline, parallel</li>
<li><strong>Imports</strong>: stats, graphics, methods, FME, deSolve, R6</li>
<li><strong>Suggests</strong>: knitr, testthat, microbenchmark, ggplot2</li>
</ul>
<h2>Authors</h2>
<ul>
<li><a href="mailto:jranke@uni-bremen.de">Johannes Ranke</a> [aut, cre, cph]</li>
<li>Katrin Lindenberger [ctb]</li>
<li>René Lehmann [ctb]</li>
<li>Eurofins Regulatory AG [cph]</li>
</ul>
</div>
</div>
<footer>
<p class="pull-right"><a href="#">Back to top</a></p>
<p>Built by <a href="https://github.com/hadley/staticdocs">staticdocs</a>. Styled with <a href="http://twitter.github.com/bootstrap">bootstrap</a>.</p>
</footer>
</div>
</body>
</html>