Bayesian data integration for kinetic models written in Python. In our publication in ACS Omega we introduce the theory of our approach and evaluate different reaction mechanisms for the acceleration of trypsin autolysis caused by silica surfaces.
Interested users can reproduce the proof of concept from the paper.
The necessary jupyter notebooks can be found in tutorial_and_POC/
.
It demonstrates most options.
Users can easily modify the kinetic models shown there to their needs.
-
The synthetic data are generated in
generate_observed_data.ipynb
. This notebook is just for reference, you can find the synthetic data as shown in the SI of the paper inobserved_kin_data.csv, observed_eq_adsorption_data.csv, observed_td_adsorption_data.csv
. -
The definition of the kinetic models, priors etc. is found in
infer_parameters.ipynb
. The inference itself is also done within this notebook. Running all of it can take several hours or up to 1-2 days on your desktop machine. Upon completion, you will find the MCMC chains stored in.h5
files. These are relatively large (up to a few hundred MB) so we don't share them via GitHub. If you face a problem at this stage, feel free to contact me and I will share my results with you.LH_infer_parameters.ipynb
is analogous but with slightly different settings and priors for the LH mechanism. -
The results from the inference are analysed in
analysis.ipynb
. It contains visualizations of the posterior predictive checks, marginalized posterior distributions and the other figures from the SI of the paper concerned with the proof of concept.
This package was developed and used with Python2. Due to the end of life of Python2 by the end of 2019, I ensured compatability with Python3 as well.
On my local machine, Python3 would not work with CVODE
(which was used to obtain the results in the paper).
If you experience the same problem, try using GSL
or ODEINT
.
These worked for me using Python3 but (in my limited experience) were substantially slower than CVODE
.
If you can fix the issue with CVODE
and Python3, please create a pull request.
Under Python2, Pathos can be used to effortlessly parallelize the sampling. With Python3, parralelization is currently not possible.
Download the code/clone the repository. Don't forget to add the path to your copy to your PYTHONPATH.
chempy
(create ODE systems)pyodesys
(solve ODE systems)emcee
(MCMC sampling)pymc
(Gelman-Rubin diagnostics)pytables
(h5 files manipulation)
Only for parallelization:
For you convenience, you can create a new conda environment with all necessary dependencies from environment_p2.yml
.
@article{toetsch2020bayesian,
author = {Tötsch, Niklas and Hoffmann, Daniel},
title = {Bayesian Data Integration Questions Classic Study on Protease Self-Digest Kinetics},
journal = {ACS Omega},
volume = {5},
number = {25},
pages = {15162-15168},
year = {2020},
doi = {10.1021/acsomega.0c01109},
URL = {https://doi.org/10.1021/acsomega.0c01109},
eprint = {https://doi.org/10.1021/acsomega.0c01109}
}