• strict warning: Non-static method view::load() should not be called statically in /home/peco/webapps/dp6_peter/sites/default/modules/views/views.module on line 906.
  • strict warning: Declaration of views_handler_argument::init() should be compatible with views_handler::init(&$view, $options) in /home/peco/webapps/dp6_peter/sites/default/modules/views/handlers/views_handler_argument.inc on line 744.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home/peco/webapps/dp6_peter/sites/default/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /home/peco/webapps/dp6_peter/sites/default/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_plugin_style_default::options() should be compatible with views_object::options() in /home/peco/webapps/dp6_peter/sites/default/modules/views/plugins/views_plugin_style_default.inc on line 24.
  • strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home/peco/webapps/dp6_peter/sites/default/modules/views/plugins/views_plugin_row.inc on line 134.
  • strict warning: Declaration of views_plugin_row::options_submit() should be compatible with views_plugin::options_submit(&$form, &$form_state) in /home/peco/webapps/dp6_peter/sites/default/modules/views/plugins/views_plugin_row.inc on line 134.

Simulating electrophoresis

Comparison of virtual gels with different exposures and running times

I made a start on Pygame simulation of an agarose gel on which virtual DNA can be run. The simulation has a number of stages:

  • A gel is made with a given concentration of agarose and size (length and number of lanes).
  • Any of the lanes can be loaded with a solution of DNA. Solution are currently lists of DNA strand lengths and their concentrations, but this will have to improved allow for more complex experiments involving metabolites and proteins.
  • The gel is then run for a number for a specified number of minutes and at a chosen voltage. This moves the position of the various lengths of DNA. At present, they move at a rate proportional to 1 / length, which isn’t a very good simulation.
  • Finally, once the gel has been run, it can be exposed on a UV transilluminator for a certain length of time. The longer the exposure, the brighter the signal, but also the background.

In the gel image, the bottom band corresponds to 100 base pairs (bp) and the second band up to 200 bp. The 100 bp DNA has travelled twice as far as the 200 bp using my function, which is not a very realistic simulation. I have some ideas about how to improve it (and to take into account the agarose concentration), but I’m surprised how difficult it is to think of a sensible formula for movement [see the next post for a much better movement formula]. I have heard that the size separation actually only occurs because of the time it takes different lengths of DNA to line up in the gel, and that once lined up they travel the same speed regardless of length (hence why pulsed field gel electrophoresis can separate larger lengths of DNA), but I’m not convinced.

There is lots more I can do – adding noise, allowing magnification on the transilluminator, changing the aperture, adding diffusion, but first I should sort of the equation for determining how fast DNA of different lengths moves. The image produced is returned by the gel object, where it can be displayed or saved – perhaps to go into a virtual lab book.

Below is an updated version of the program based on an equation described at: http://www.petercollingridge.co.uk/science-simulation/gel-electrophoresis-mathematics

simGel.txt6.44 KB


You are so clever.


is the code available? it looks really interesting!
Have you considered contributing it to biopython?


Thanks Björn,

It's a while since I've looked at the code. I'll give it a quick check and make sure it still works as I expect, then I'll upload it here. I keep meaning to make an online version for people to play with, maybe for educational purposes.

I'm hadn't considered submitting it to BioPython. I'm not sure whether anyone would be that interested given that it's based on some equations I just made up, and from what I can tell, don't accurately model the actual rate of DNA movement through the gel.

Post new comment

The content of this field is kept private and will not be shown publicly.