PyCellChemistry Online Documentation
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.
- 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.
- The core of PyCellChemistry depends only on
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
for convenience. These scripts run the various artificial chemistry
examples and plot the results.
Many of them rely on
for plotting, some on
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.
stackoverflow bloggers and the
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):
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
autocatalytic sets of proteins
and the matrix chemistry
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
or the Oregonator model of the Belousov-Zhabotinsky reaction
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 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.
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.
W. Banzhaf. The "molecular" traveling salesman. Biological Cybernetics, 64(1):7-14, 1990.
W. Banzhaf, Self-replicating sequences of binary numbers, Computers and Mathematics with Applications, 26:1-8, 1993.
Self-replicating sequences of binary numbers. Foundations I: General,
Biological Cybernetics, August 1993, Volume 69, Issue 4, pp 269-274.
Dittrich, P. and Ziegler, J. and Banzhaf, W.,
Artificial Chemistries -- A Review,
Artificial Life, volume 7, number 3, 2001, p. 225-275,
P. Dittrich and P. Speroni di Fenizio, Chemical Organisation Theory,
Bulletin of Mathematical Biology 69(4):1199-1231 (2007).
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.
M. B. Elowitz and S. Leibler, A synthetic oscillatory network of transcriptional regulators, Nature, 403:335-338, January 2000.
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.
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).
Gillespie, D. T., Exact Stochastic Simulation of Coupled Chemical Reactions, Journal of Physical Chemistry, volume 81, 1977, p. 2340-2361.
Gillespie, D. T., Stochastic Simulation of Chemical Kinetics, Annual Reviews of Physical Chemistry, volume 58, 2007, p. 35-55.
P. Gray and S.K. Scott,
"Chemical Oscillations and Instabilities: Nonlinear Chemical Kinetics",
Oxford Science Publications, 1990.
S. A. Kauffman. Autocatalytic sets of proteins, Journal of Theoretical Biology, 119:1-24,1986.
S. A. Kauffman. The origins of order: Self-organization and selection in evolution. Oxford University Press, 1993.
A. J. Koch and H. Meinhardt,
"Biological Pattern Formation: From Basic Mechanisms to Complex Structures",
Reviews of Modern Physics, 66(4), 1994.
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.
"Models of Biological Pattern Formation",
Academic Press, 1982.
Hans Meinhardt, "The Algorithmic Beauty of Sea Shells", Springer, 2003.
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.
T. Meyer and C. Tschudin, Chemical networking protocols, Proc. 8th ACM Workshop on Hot Topics in Networks (HotNets-VIII), Oct. 2009.
M. Nowak, Evolutionary Dynamics: Exploring the Equations of Life, Belknap Press of Harvard University Press, 2006.
John E. Pearson,
"Complex Patterns in a Simple System",
Science, volume 261, number 5118, July 1993, pages 189-192.
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.
P. Winkler. Puzzled: Understanding relationships among numbers. Communcations of the ACM, 52(5):112, 2009.
P.Winkler. Puzzled: Solutions and sources. Communcations of the ACM, 52(6):103,2009.
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.
Lidia Yamamoto and Wolfgang Banzhaf, Emergence in Artificial Chemistries, talk at the 4th Conference on Emergence in Chemical Systems, Anchorage, Alaska, June 2015.
Artificial Chemistries: Overview and Computing Aspects,
online talk at the e-track
"Engineering and Control of Self-Organization",
Conference on Complex Systems, October 2015.
Last updated: September 30, 2015, by Lidia Yamamoto