PyCellChemistry Online Documentation
Contents:
About PyCellChemistry
PyCellChemistry is a software package for the design and development of Artificial Chemistries (ACs) and for the exploration of their behavior. It is intended to facilitate people to program their own artificial chemistries in Python, a programming language that is especially accessible and easy to learn. The package illustrates how to implement artificial chemistries through simple examples.
Beware that in contrast with related AC packages, PyCellChemistry does not focus on the usage a specific chemistry, but on the implementation of a variety of chemistries. Therefore the user of PyCellChemistry must have at least some notions of programming, especially object-oriented programming. Some guidelines for beginners are available here.
The package has been designed with a minimalistic philosophy in mind. Our main concerns were an easy installation and programming, enabling a quick start for new users. Therefore we have tried to reduce the amount of external libraries and packages required to a minimum. Hence the basic package does not offer fancy graphics and user interfaces, in order to avoid dependency on elaborated graphics support.
However, since graphics and visualization are also important in artificial chemistries, they are being integrated into the system in an incremental way: first of all, a few optional shell scripts are included in the package, that visualize various results using gnuplot and python matplotlib. Version 2.0 includes examples of reaction-diffusion chemstries that can be visualized interactively on top of VPython.
Disclaimer: The package is provided as is, without any guarantees. Although we have done our best to offer a functional package, it is still possible that bugs persist to date. Beware that the package has been designed for maximum ease of use and didactic content, and not necessarily for maximum efficiency. We believe that the main usage of this package is as a rapid prototyping tool to test and compare a variety of ACs.
Getting started
- Platforms:
- PyCellChemistry has been tested under Python 2.6 and 2.7, on MacOS and
Linux. The software is designed to be as platform independent as
possible, so we expect that it should run on other platforms as well,
although we had no opportunity for extensive testing so far.
- Requirements:
- The core of PyCellChemistry depends only on
numpy.
Most of the examples generate tab-separated output files that can be
plotted with your favorite plotting tool (R, Matlab, Excel, ...)
- Optional shell scripts are provided in the
src/scripts
folder,
for convenience. These scripts run the various artificial chemistry
examples and plot the results.
Many of them rely on
gnuplot
for plotting, some on
python matplotlib.
-
Version 2.0 includes Reaction-Diffusion examples that can be visualized interactively with VPython.
Alternatively, snapshots in PNG format can be generated at regular intervals.
These snapshots can be later combined into animations or movies.
Thanks to
stackoverflow bloggers and the
Blender team,
these PNG files can be generated from python+numpy without any extra library requirements.
- Downloading the package:
- Source code in zip format:
- Source code in compressed tar format:
- Installing and running the latest version (click here for earlier versions):
Warming up
The first step to build an artificial chemistry is to decide whether it should be constructive or not:
- A constructive chemistry enables new molecule species to be created which had not been "pre-programmed" in the system beforehand. The creation of such novel species opens up the possibilities for new reaction pathways too. AlChemy
[Fontana1994],
autocatalytic sets of proteins
[Kauffman1986],
and the matrix chemistry
[Banzhaf1993]
are examples of constructive chemistries.
- A nonconstructive chemistry, on the other hand, presents a fixed set of molecular species and their reactions, well-known by design time. This is the case of designed molecular circuits such as the repressilator
[Elowitz2000]
or the Oregonator model of the Belousov-Zhabotinsky reaction
[Field1974].
Building a nonconstructive chemistry:
A constructive chemistry:
Adding the notion of space:
The examples above showed well-mixed chemistries, but these have limited applicability. Most of the more realisitc chemistries live in a two- or three-dimensional space, or in networks of interconnected computers. In PyCellChemistry version 2.0 we have included a few examples of reaction-diffusion systems, that extend upon the basic reaction system of PyCellChemistry with a two-dimensional grid where chemicals can diffuse and react, forming various patterns.
A very well-known example of reaction-diffusion is the Gray-Scott system, where various patterns may form, including self-replicating spots, stripes, and spirals [Pearson1993] [Mazin1996]:
Delving deeper into the chemistries:
More details about the other chemistries in the package will appear in this section soon...
Meanwhile a reference page for each module is available in the manual below.
Reference Manuals
Reference Manual for PyCellChemistry-2.0
Reference Manual for PyCellChemistry-1.0
Writing your own AC
The tutorials and examples provided are intended to provide some basic concepts and initial ideas about ways to program new ACs. One of the best ways to learn is via examples, hence we suggest that after playing with the examples, you start your own chemistry by modifying or extending some of these examples. We believe that once the core elements of your chemistry operate well in Python, it will be easier for you to move on to a computationally more efficient implementation in C, C++, Java or other programming languages.
Contributing
We welcome any ideas and contributions. PyCellChemistry is free software, under the terms of the
GNU General Public License (GPL).
It has primarily an educational goal.
We hope that it will foster a community of developers around common methods and best-practice procedures to program ACs, to learn how to program ACs, and to improve their accessibility, such that new and relevant applications can be more easily constructed based on the AC concept.
In the future we should set up a repository for collaborative software development, for instance from github or sourceforge. For now however, please send any bug reports or other remarks concerning the software or the web site to Lidia Yamamoto.
Bibliography
-
[Banzhaf1990]
W. Banzhaf. The "molecular" traveling salesman. Biological Cybernetics, 64(1):7-14, 1990.
-
[Banzhaf1993a]
W. Banzhaf, Self-replicating sequences of binary numbers, Computers and Mathematics with Applications, 26:1-8, 1993.
-
[Banzhaf1993b]
W. Banzhaf,
Self-replicating sequences of binary numbers. Foundations I: General,
Biological Cybernetics, August 1993, Volume 69, Issue 4, pp 269-274.
-
[Dittrich2001]
Dittrich, P. and Ziegler, J. and Banzhaf, W.,
Artificial Chemistries -- A Review,
Artificial Life, volume 7, number 3, 2001, p. 225-275,
-
[Dittrich2007]
P. Dittrich and P. Speroni di Fenizio, Chemical Organisation Theory,
Bulletin of Mathematical Biology 69(4):1199-1231 (2007).
-
[Eigen1977]
M. Eigen and P. Schuster. The hypercycle: A principle of natural selforganization, Part A: Emergence of the hypercycle, Naturwissenschaften, 64(11):541-565, November 1977.
-
[Elowitz2000]
M. B. Elowitz and S. Leibler, A synthetic oscillatory network of transcriptional regulators, Nature, 403:335-338, January 2000.
-
[Field1974]
Richard J. Field and Richard M. Noyes,
"Oscillations in chemical systems IV: Limit cycle behavior in a model of a real chemical reaction",
Journal of Chemical Physics, volume 60, number 5, March 1974, p. 1877-1884.
-
[Fontana1994]
Fontana, W., Buss, L.W.: The arrival of the fittest: Toward a theory of biological organization. Bulletin of Mathematical Biology, 56(1):1-64 (1994).
-
[Gillespie1977]
Gillespie, D. T., Exact Stochastic Simulation of Coupled Chemical Reactions, Journal of Physical Chemistry, volume 81, 1977, p. 2340-2361.
-
[Gillespie2007]
Gillespie, D. T., Stochastic Simulation of Chemical Kinetics, Annual Reviews of Physical Chemistry, volume 58, 2007, p. 35-55.
-
[GrayScott1990]
P. Gray and S.K. Scott,
"Chemical Oscillations and Instabilities: Nonlinear Chemical Kinetics",
Oxford Science Publications, 1990.
-
[Kauffman1986]
S. A. Kauffman. Autocatalytic sets of proteins, Journal of Theoretical Biology, 119:1-24,1986.
-
[Kauffman1993]
S. A. Kauffman. The origins of order: Self-organization and selection in evolution. Oxford University Press, 1993.
-
[Koch1994]
A. J. Koch and H. Meinhardt,
"Biological Pattern Formation: From Basic Mechanisms to Complex Structures",
Reviews of Modern Physics, 66(4), 1994.
-
[Mazin1996]
W. Mazin, K. E. Rasmussen, E. Mosekilde, P. Borckmans,
and G. Dewel,
"Pattern formation in the bistable Gray-Scott model",
Mathematics and Computers in Simulation, Volume 40, 1996, pages 371-396.
-
[Meinhardt1982]
Hans Meinhardt,
"Models of Biological Pattern Formation",
Academic Press, 1982.
-
[Meinhardt2003]
Hans Meinhardt, "The Algorithmic Beauty of Sea Shells", Springer, 2003.
-
[Meyer2008]
T. Meyer, L. Yamamoto, and C. Tschudin, An artificial chemistry for networking, Bio-Inspired Computing and Communication, volume 5151 of Springer LNCS, 2008, p. 45-57.
-
[Meyer2009]
T. Meyer and C. Tschudin, Chemical networking protocols, Proc. 8th ACM Workshop on Hot Topics in Networks (HotNets-VIII), Oct. 2009.
-
[Nowak2006]
M. Nowak, Evolutionary Dynamics: Exploring the Equations of Life, Belknap Press of Harvard University Press, 2006.
-
[Pearson1993]
John E. Pearson,
"Complex Patterns in a Simple System",
Science, volume 261, number 5118, July 1993, pages 189-192.
-
[Tschudin2003]
C. Tschudin, Fraglets: A Metabolistic Execution Model for Communication Protocols, Proc. 2nd Annual Symposium on Autonomous Intelligent Networks and Systems (AINS), Menlo Park, USA, July 2003.
-
[Winkler2009a]
P. Winkler. Puzzled: Understanding relationships among numbers. Communcations of the ACM, 52(5):112, 2009.
-
[Winkler2009b]
P.Winkler. Puzzled: Solutions and sources. Communcations of the ACM, 52(6):103,2009.
-
[Wolkenhauer2004]
Olaf Wolkenhauer, Mukhtar Ullah, Walter Kolch, Kwang-Hyun Cho, Modelling and Simulation of Intracellular Dynamics: Choosing an Appropriate Framework, IEEE Transactions on Nano-Bioscience volume 3, number 3, 2004, p. 200-207.
-
[Yamamoto2015a]
Lidia Yamamoto and Wolfgang Banzhaf, Emergence in Artificial Chemistries, talk at the 4th Conference on Emergence in Chemical Systems, Anchorage, Alaska, June 2015.
-
[Yamamoto2015b]
Lidia Yamamoto,
Artificial Chemistries: Overview and Computing Aspects,
online talk at the e-track
"Engineering and Control of Self-Organization",
Conference on Complex Systems, October 2015.
[video]
Last updated: September 30, 2015, by Lidia Yamamoto