aboutsummaryrefslogtreecommitdiff
path: root/inst/web/index.html
blob: a08af34fac0f516bc99a74a0807cff3d762ebf31 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
<title>Index. mkin 0.9-41</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-41</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.rstudio.com/web/packages/mkin/index.html"><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(&quot;mkin&quot;)
</code></pre>

<p>If looking for the latest features, you can install directly from 
<a href="http://github.com/jranke/mkin">github</a>, e.g.  using the <code>devtools</code> package.
Using <code>quick = TRUE</code> skips docs, multiple-architecture builds, demos, and
vignettes, to make installation as fast and painless as possible.</p>

<pre><code class="r">require(devtools)
install_github(&quot;jranke/mkin&quot;, quick = TRUE)
</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
&#39;Credits and historical remarks&#39; 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>Model optimisation with 
<a href="http://kinfit.r-forge.r-project.org/mkin_static/mkinfit.html"><code>mkinfit</code></a>
internally using the <code>modFit</code> function from the <code>FME</code> package,
but using the Port routine <code>nlminb</code> per default.</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 = &quot;obs&quot;</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, 
either IORE kinetics (often producing failures of the integration algorithm)
or SFORB kinetics (working nicely) can be used for the metabolite, adding one
respectively two parameters to the system.</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>,
<a href="http://cran.r-project.org/package=minpack.lm">minpack.lm</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> was 
<a href="https://r-forge.r-project.org/scm/viewvc.php?view=rev&amp;root=kinfit&amp;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&amp;root=kinfit&amp;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&hellip; 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><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 specifc 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>
  </div>
  
  <div class="span3 offset1">
    <h2>Vignettes</h2>
    <ul>
      <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/FOCUS_Z.pdf">Example evaluation of FOCUS dataset Z</a></li>
      <li><a href="vignettes/mkin.pdf">Routines for fitting kinetic models with one or more state variables to chemical degradation data</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</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>

Contact - Imprint