Cellular automaton model of bacterial biosensors

So this fortnight at the doctoral training centre, we've been from "Hello World" to image processing in C and Perl. Yeah.

Anyway, before my brain explodes from over-knowledge-ness, I thought I'd blog about the program I made! It's a cellular automaton (like Conway's Game of Life) that essentially represents lots of bacteria immobilised on a silicon chip. I based it on this paper from 2004. In my simulation, the cells grow, divide and die based on how much food they are getting from the environment.

The bacteria contain a special gene from fireflies called luciferase, which allows them to bioluminesce. Halfway through the simulation, the cells are bathed in a solution that causes DNA damage. This activates the luciferase gene. The idea behind the original experiment was to use bacteria to sense when a molecule causes DNA damage, in order to screen for molecules that might cause cancer.

A picture of the simulation running

The simulation outputs a rudimentary display to the terminal. The glowing bacteria are represented by the letter "O" and the wild-type bacteria are shown by the "#" symbol.

If you want to read more about the biological background and the implementation, you can read my report, or try compiling and running my C code.

This was a really good opportunity to test out all the things I learned about C this week! In addition, the write-up I handed in was written in LaTeX, which I am completely new to. I've uploaded my Tex files (report.tex and code.tex) and the bibliography file (cellularautomata.bib, which was created by Mendeley) if you want to have a look at them - it turns out that the trick with LaTeX is just to have a template file to build on.

I found a useful bit of LaTeX code to stitch two PDFs together (which you can download as a file):

\documentclass[11pt,a4paper]{article}

\usepackage{pdfpages}
\begin{document}

\includepdf[pages={1-5}]{writeup.pdf}
\includepdf[pages={1-7}]{code.pdf}

\end{document}

Pretty cool, huh? I've put all the LaTeX bits together in a .tar.gz file here. To extract and compile, run these commands in sequence:

tar -xzvf tex-files.tar.gz
pdflatex writeup.tex
bibtex writeup.aux
pdflatex writeup.tex
pdflatex writeup.tex
pdflatex code.tex
pdflatex stitch.tex

...