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

...

Modelling endocytosis in baker's yeast

For my lab project this year I made a computer model of a biological process.

The organism I was looking at was budding yeast - also known as baker's, or brewer's yeast. It's a type of single celled fungus that's super useful in the kitchen, and is used a lot by biologists for finding out more about the things that happen in cells. Yeast cells sometimes need to recycle the proteins on their outer membrane.

First, a little pit appears in the membrane where the protein (depicted in pink) is.

Then, the pit elongates into a tube shape.

From the end of the tube, a round compartment buds off.

The compartment travels into the cell, where its contents are sorted.

 

I was looking at the elongation step of this process. My simulation calculates the length of the tube over time.

I wrote it in Python, and I'm releasing it freely under GPL. It consists of four core programs:

  • main.py - the central program (I made an extra version that runs several times - repeatedmain.py)
  • classes.py - this module contains descriptions of all the agents in my model
  • parameters.py - this contains all the constants, like the temperature
  • functions.py - this contains all the functions called by main.py

I also made four graphics programs that use the data output:

You can vary lots of the parameters and see what effect they have on the results. The results my simulation gives out aren't very close to what really happens in cells. I was looking at only a few of the proteins involved, but in reality there are dozens. Hopefully the next student who builds on my code will bring it a little further towards the real world.

If you want more information, I have some PDFs of my final reports. For a brief overview, here's the presentation I gave last week. For a less brief overview, here's my written report (figures here). Woo, science!

A big thank you to my supervisor, Rhoda and my co-supervisor Kathryn.

...

Modifying a FLAME model

As I mentioned in my previous post about my adventures in FLAME modelling, I started out with code from my lecturer. I started with three two-dimensional models, each of which contained a different type (genus) of bacteria (Vibrio, Sar11 and "Bacteria X"). Each bacteria agent had X and Y co-ordinates, an ID and a radius. The radius was different for each type of bacteria, and it defined the rules that applied to that bacteria. They moved around by Brownian motion, and if they hit a virus there was a certain probability that they would be killed. The phages moved around in a similar fashion.

My code can be downloaded from here. In this post, I'm going to take you through how I converted these three models into a single model, added a third dimension, and persuaded the viruses and bacteria to replicate. This is a tale of how it's possible to do some quite cool things to a program even if you don't fully understand how it works.

If you're particularly interested, you can download a PDF of the report I handed in here. It starts with a brief review of a mathematical bacteriophage model, then goes on to the FLAME model in the second half (page 2). I got a mark of 95% for it, so I'm showing it off to everyone ^_^

Continue reading Modifying a FLAME model

...