Showing posts with label computational biology. Show all posts
Showing posts with label computational biology. Show all posts
0 comments Sunday, October 7, 2007

DNA Painter is a small application that reads a nucleotide sequence and outputs an image. The logic behind it is pretty simple. I coded it while being influenced by ideas of cellular automata although it, technically, is not implementing those ideas.

The program works by reading a nucleotide string (A, T, C, or G) and applying logic to the current character. Each nucleotide gives the program a different and simple instruction.

  • A: Move one pixel down and add some red to the current color
  • T: Move one pixel right and add some green to the current color
  • C: Move one pixel up and add some blue to the current color
  • G: Move one pixel left and do something wacky (I think the current build right now just darkens the pixel)
In Actionscript 3.0 a pixel is a 32 bit number with 8 bits corresponding to the Alpha (transparency), Red, Green, and Blue values respectively. By mapping the RGB values to certain nucleotides I'll get at least 3 colors per image. Since chances are good that certain pixels will be painted on more than once the combination of two or more RGB values will result in a different color (red + blue = magenta, etc). This means that any image, given a long enough nucleotide sequence, will result in a multitude of color.

Application


Although I created DNA Painter as an expression of art through computation and science one use of DNA Painter is the creation of visual representations of genes. The application can output an image based off of, say, the aldolase gene of three different mammalian species so the relative divergence of the gene can be seen. Yes, I realize that using some sort of bioinformatic statistical analysis on the actual DNA string will be much better. But it's not cool you see, and in this world we need cooo-oool.

Notes on usage

Some things to think about while playing around with the program:
  • A long red line in an image means the mapped gene has a long series of A (adenine) and a long green horizontal line means T (thymine) and so on.
  • A stair step in the image is a sequence of alternating nucleotides
  • Increasing the bitmap size will show a more accurate picture of the gene. This is because the drawing wraps when it reaches an edge of the bitmap. So a larger bitmap means less overlap so less "noise".
  • The five available genes that are embedded in the application are all human genes


More Info on the genes

Further Development


Although I would like to make the images prettier by applying filters and other effects I think I would like to focus more on the application of the program rather than the aesthetics. It would be nice to remove the wrap effect so each gene or sequence will be a consistent image no matter the bitmap size. This will allow the user to zoom in and out (and pan). It'll allow the visualization of repeating sections of nucleotides that can be shown to exist across related genes. Furthermore, by applying the application to mRNA we could break down each image to a series of codons.

Now that I think about it we could create a catalog of common DNA sequences. Whoa!

0 comments Wednesday, September 19, 2007

Comprehensive, collaborative, ever-growing, and personalized, the Encyclopedia of Life is an ecosystem of websites that makes all key information about life on Earth accessible to anyone, anywhere in the world. Our goal is to create a constantly evolving encyclopedia that lives on the Internet, with contributions from scientists and amateurs alike. To transform the science of biology, and inspire a new generation of scientists, by aggregating all known data about every living species. And ultimately, to increase our collective understanding of life on Earth, and safeguard the richest possible spectrum of biodiversity.

I get goosebumps every time I watch the promo video for the Encyclopedia of Life. It was launched back in May and I haven't heard anything about it since then. If E. O. Wilson pulls this off it could be the best thing to hit the internet. Ever.

0 comments Sunday, August 12, 2007

The morphology of plants is structured in such a way that repetitive patterns occur. This is termed modular organization and is a method of defining certain repetitive structures of a plant. If we consider a single instance of a leaf or a branch as a module then we can reduce a (very) simplified tree to being just a collection of these two components. If we are in need of representing a tree programmically then realizing the above makes things much easier. Even more interesting Ferra et al. (2005) states that “in some cases, the modules are arranged into compound, recursively nested, fractal-like structures, with similar patterns appearing at different scales.”

fern


Ferra et al. mentioned that many plants have fractal-like structures. So what are they? Fractals are statistically self-similar structures, which, according to Mandelbrot (1982), is “when each piece of a shape is geometrically similar to the whole, both the shape and the cascade that generate it are called self-similar.” To see this graphically it'll help to refer to the picture of the fern. Each pinnule (the smallest 'leaf') of the fern is geometrically similar to each pinna which is geometrically similar to the entire fern. Nature repeats and beauty is a result.

Below is a flash application that I created by modifying code written by Matt Pearson (2007). The tree is composed of a 'trunk' and a 'leaf' both of which are laid down by a recursive function. Click it to randomly generate a new tree.



Sources

[1] B. B. Mandelbrot. The fractal geometry of nature. W. H. Freeman, San Francisco, 1982.
[2] Ferrao P., Godin C., Prusinkiewicz P. Toward a quantification of self-similarity in plants. Fractals, 2005. http://algorithmicbotany.org/papers/similar.fractals2005.pdf
[3] Pearson, M. Fractals in ActionScript 3 - A Flash Tutorial. zenbullets.com. 2007. http://zenbullets.com/blog/?page_id=80
[4] http://www.flickr.com/photos/roddh/156854158/