Monday, July 26, 2010

Traitwise coding survey

We're almost ready to release the beta version of our survey engine: As a test of the embedded private surveys, I've created this short 10 question survey for my nerd friends to resolve a couple of hypotheses I have about coding styles and coding experience. So, to all my coding friends -- please take a few seconds to honestly answer this survey and to report any bugs or problems you find in the engine.

Sunday, July 18, 2010

Chemotaxis CheZ position experiments


Bacteria swim by their noses. That is, they smell food and swim towards it; they smell waste and swim away. The molecular basis of this amazing feat is the most well studied molecular signal transduction system and as such serves as a model for other lessor-studied bio-molecular signaling.

There's one little detail of the chemotaxis system that caught my attention a few years ago. The signal is transmitted from sensor to motors via a diffusing molecule called "CheY". When CheY has a phosphoryl group attached to it, it activates the motors in a certain way; when it loses that group it reverses the motors.

There's a very interesting subtlety to this system. The part of the system which "charges" the transmitter (to borrow electrical engineering terminology) is a kinase called CheA. The "discharging circuit" is the enzyme CheZ. It turns out that these two enzymes are, counter-intuitively, co-located. That is, it seems odd that the enzymes responsible for pulling-up a signal are co-located with the enzymes that pull it down. It would appear that the system is spinning it's wheels -- undoing what it just did. Why shouldn't it have the pull-down phosphatase evenly distributed or co-located with the motors?

When I first read this detail a few years ago in Eisenbach's book "Chemotaxis" it mentioned this counter-intuitive fact and I thought to myself, "I bet I know why -- it reduces saturation and evens out the signal." I wrote a little simulation years ago and convinced myself that this was indeed the case (at least for my toy simulation). Then I got distracted for years didn't get around to improving the simulations.

My hypothesis is that by co-locating CheZ and CheA the signal will saturate less near the transmitter and become more spatially uniform. My intuition is that when the external signal is rising and transmitter wishes to control the motors it needs a supply of free un-phosphorylated CheY in order to communicate this. Because CheY is produced at one end and diffuses to the other regions, there's a 1/r^2 distribution of it as it produces it. If it turns on the transmitter at some moment then a few moments later there will be an excess of CheY~P near the transmitter but a lot less further away. But, if CheZ is located nearby the transmitter then it is right where it is needed most -- where there's an excess of CheY~P.

Honestly, it's easier to see the effect than to describe it.

In the following figures, the top row has the CheZ co-located with CheA on the left side. The bottom row has the same amount of CheZ evenly distributed. These are space-time plots. Space is on the X axis with the transmitter on the left. Time progresses from the bottom of the graph towards the top. The right plot is the power spectrum of the right most spatial position which simulates the most distant motor's response. In the top row we see two things. First, the distribution is much smoother from left to right than it is in the bottom row. This is good for the bacteria as the motors are scattered throughout the cell and the controller depends on them to synchronously changing state as it switches from laminar movement to chaotic tumbling. Second, the non-linear clipping harmonic (the little spike on the right) is taller in the bottom row and the primary response (the big peak) is a little smaller. This indicates that there's a (mild) fidelity improvement in the co-location of CheA and CheZ. Given the simplicity of this argument I submit that such co-location is probably a common motif in other kinase/phosphatase (and similar pull-up/pull-down type) systems.

Caveats -- this is a scale-free simulation. I made no attempt to model actual parameters but rather went on the assumption that the bacteria probably operates near peak efficiency so I just twiddled the parameters until I saw what appeared to be peak efficiency. Of course, this is hardly rigorous so the next step will be to try to get accurate rate and diffusion constants. If anyone knows where they are conveniently located in one paper, that would be nice. :-)

2D stadium wave

I finally got around to making my previous stadium wave simulation run in 2D. It makes pretty patterns as I expected it would. The fascinating thing about it is that there's these interior waves that back propagates as the outer wave spreads out. There's some sort of instability that causes little imperfections (probably due to the imposed spatial lattice) that gets these little eddies started and once their started they tend to collide and make interesting things happen. The simulation is torodial so once the wave hits the edges it interacts with itself and then all kinds of beautiful things happen. (Note, the image looks wider than it really is -- what looks like an oval is actually a circle.)

Sunday, July 11, 2010

The similarity between New Testament textual analysis and bacterial plasmid phylogeny

In Prof. Bart Ehrman's excellent lecture series from the Teaching Company called "From Jesus to Constantine" he spends some time explaining the history of the documents of the New Testament. He describes various motifs of textual mutation caused by scribes' errors and theological corrections.

I was struck by the similarity between these motifs and the same motifs in biological DNA mutation.

The most obvious are the point mutations. There are many tens of thousands of spelling differences among the Greek and Latin manuscripts. The vast majority of these are irrelevant as they do not change the interpretation of the text. In biological terms, we might call these "point mutations of synonymous coding regions" which is a really fancy way of saying "spelling mistakes" that do not change the interpretation -- the functionality -- of the DNA. Prof. Ehrman points out that, including these textual point mutations, there are more differences in the Greek manuscripts of the New Testament than there are words!

The second motif is selection. As theological beliefs wandered throughout the centuries, the scribes forced "corrections" on the text to make it more in line with contemporary thought. One example he mentions is the story in Luke of Jesus and his family visiting Jerusalem. In the story the family accidentally leaves Jesus behind. 3 days later (!) they realize they forgot him and go back to find him in the Temple. In the Greek manuscripts Mary says: "You're father and I have been looking all over for you." But at the time the manuscript was being copied many centuries later, the theological orthodoxy had incorporated the story of the virgin birth so how could this passage be right: "your father and I have been looking..." so it was changed to "we've been looking...". This adaption was more "theological fit" than its cousins and was thus selected for in manuscripts over the ages.

The third -- and most incredible -- is the similarity between bacterial plasmids and marginal insertion mutations. The copied manuscripts were used by teachers and would sometimes end up with marginal notes -- writings in a different hand scribbled in the margins of the book. One example of this is the line in first Corinthians chapter 14:34 that "women should remain silent in the churches". Sometimes a scribe would read these marginal notes and think: "that's a good bit, I will maintain it into the next copy." What begins in separate hand becomes a marginal note now written with the same hand as the main-line text. Another generation or more later another scribe comes along and sees this marginal note and thinks: "What's this doing in the margins?" and inserts it into the main line text.

Similarly, in bacteria and other organisms, there's sometimes extra loops of DNA that are independent of the main-line chromosome called "plasmids". These stand-alone pieces of DNA are copied independently of the main-line but are occasionally inserted into the main-line. Once inserted, like the inserted marginal text, they cannot be distinguished from the original thus they become a permanent part of the main-line code. Because we have the sequences of thousands of bacteria, we can see evidence of this throughout history.