Archive for the ‘Mathematical Modeling’ tag
iGEM*BIC — An Awesome Meeting
About two weeks ago (Feb. 11th), we had an iGEM*BIC meeting where five iGEM members showed up and roughly a dozen BIC members showed up. I expected a few more from iGEM but they ended up with illnesses or midterm exams that week.
We started the meeting with a nice description of BIC from Anna, followed by a nice description of iGEM at large then iGEM at home from Andre. I then finished with a collaborative projects presentation.
I’ve attached the slides I presented (actually, I’ve updated them since then)– just like the very last set of slides for the Python Crash Course, I ended up using iWork Pages this time around instead of NeoOffice.
Download: Updated slides [pdf].



The meeting was designed to go for half an hour because of its proximity to midterms. We ended up discussing for about two hours about all of the projects we wanted to try this term– everything from the now defunct Bunny Buddy to BactoBones to BactoHouseMD.
Anna had remarked earlier that iGEM isn’t well marketed to CS students or BIC– so this will certainly be a recurring thing at the beginning of each semester. This is particularly important summer because the next stream of BIC students are returning from co-op.
The general consensus is that everyone was interested in doing *something* in iGEM which is a real bonus. This Wednesday, we’re going to have a modeling meeting that’s punctuated with John’s mini-project talk. I’m hoping that many BIC members will show up to carry over their interest.
My original assessment that most BIC students would want to do in silico modeling and software development was far off. As it turns out, BIC students showed interest in every facet of iGEM from wet lab to software development to outreach and public relations.
A direct consequence of the iGEM*BIC meeting is that we had a much larger design meeting the next day (Feb. 12th)– thirteen showed up.
Finally, the feeling of the group is that the next crossover meeting should be more social. I think that’s something we can shoot for, for early summer.
First UWiGEM modeling meeting: Wed. Jan. 21 @6pm
Update: The Gleave Library, B1-273 has been booked for this occasion!
Brief: The two software projects that will precede the main body of Waterloo iGEM 2010 will be discussed on Wednesday January 21 from 6pm to 8pm. I will update this post once a room booking has been confirmed.
Related topic here on the Waterloo iGEM Discussion Board.
The Return of Phi C31
I’ve been so out of the loop with iGEM over the last month. I’ll need to figure out how to get back into the swing of things, probably starting with the post mortem meeting on Tuesday. Generally, since no new maths could be put on the table that actually encompassed the problem well– the brute force approach was kicked into high gear with a few more filters to increase the probability of success.
Call these “System Filters” since they aren’t really based on biologically significant concepts, really just sanity checks that are conceptually consistent with the project (i.e. we’d run out of hard disk space otherwise…). Significantly, Matthew implemented “Blank Stare”, which destroys reactants that exceed a given length (thus preventing them from hogging the CPU looking for less parsimonious solutions). Less significant were Andre’s “Lone Gunman” which deletes arbitrary chromosomes with stochastic efficiency and my “Tag” which prevents chromosomes from cross reacting.
(On second thought, “Tag” IS a “Biological Filter” not a “System Filter” because it removes redundancy by implementing the rule that we only admit bacteria that have exactly one chromosome.)
I should mention that “significance” above isn’t about the triviality of the code, it’s about the amount of anticipated efficiency boon we’d gain from an item’s deployment.
Tomorrow’s post mortem will continue the work I’ve started on our iGEM 2009 Wiki Modelling page… We’ll decide what we want to mention, how close we got to our solution and figure out how to precisely characterize the problem space uncovered by our various attempts.
Additionally, we should probably discuss the relevance of John’s attN site cloning and tests to see if the operators show any sign of degeneracy, and which ones in particular.
Finally, I should mention that Brandon has been working on a C++ port of the whole application we wrote in Python to elucidate how much the virtual machine impacted the performance of our solver– the team is quite divided on this idea with a big half (myself included) thinking that the exponential growth due to the algorithm is the greater factor– Brandon may have some answers for us when it’s up and running.
Knots were the wrong math
The Knot Math was eventually understood to be the wrong kind of math to model our problem on.
Knots take the form of a circle that has been broken and rejoined at a point on its circumference after being wrapped about itself an arbitrary number of times. What we’re working on doesn’t utilize any function that twists loops of DNA the same way. The knot maths provide a way to real-value-vectorize these shapes, but do not provide an easy way to insert our own data. There are two properties that relate to the incompatibility. The first is that knot maths consider two knots equal if their topology with respect to the number of twists they have are identical. Our problem does not consider these two knots equal, as distance and sequence specificity (imagine each particle on the rope circle was labeled) are required. Second, what we produce overlaps arbitrarily by lying a circle segment on top of another circle segment whereas the knot maths produce overlaps with twists. While I think there could be a clever way to identify our problem with the knot math, I don’t think there is a feasible or cost (time) effective way to do this.
Brain continues to storm.
I did managed to uncover some very exciting papers however. One of them was on a piece of software called TangleSolve– which does do site specific recombination and visualization of DNA knots– reading on this software was actually instrumental in understanding why our problem was not identifiable here. Side note– topoisomerase — is an enzyme involved with DNA knot formation and super coiling relaxation.
DNA … Knots and Lambdas
A long time ago, one Andre lead a team of students in a journey of mathematical and computational modeling; at the very least, we have reached some useful insights from our tidy trip albeit at a distance from the solution.
Presented here is a very jumbled, very abridged account of the activities of the modeling team this summer and the eventual realization that brings us to now.
The Problem Revisited
So we have a sequence. Actually, two sequences. Actually, we have two loops. Two loops of DNA that will contain a specific sequence used for cassette exchange. The problem is the design of these two loops. We want to design them so that we can predictably exchange specific objects between them. We used an enzyme for recombination that is sensitive to specific sites to perform the exchanges.
The above paragraph is an abstract-abstract of the UW iGem Project.
The Top Down Approach
What I eventually labeled in my mind as the top-down approach is called that in analogy to parsing. In parsing, we build a tree. We can do this conceptually from the bottom-up, or from the top-down. From the bottom-up, we know everything we need to know to build the tree… we know as much as we want to know, we even know if there exists not a tree for this particular string of tokens. From the top-down, we’d have to use some magical induction to chain tokens together by determining a structure that the tokens will find pleasing.
The magical induction of the top-down approach is none other than brute force. There is no magic, just an exponential explosion. The base of this power is the length of the string and the exponent of the power alludes to the complexity and depth of the grammar.
We don’t parse for the sequence problem– that is, we assume the grammar to be irrelevant, that a flat degenerate chain is a sufficient enough tree; we operate on sequences with our enzyme instead.
For our sequence problem, we pick three loops. We see if the first two loops add together with respect to the enzyme to make the third loop. By hand, one is tempted to use various heuristics of deductive logic but it became complicated and soon overflowed the allowed dozen or so objects a human brain may accommodate per instant. The machine was dragged in, and the three loops were shown to it using Python.
We presented three loops of one logical suite of tokens. It ran to completion and to no surprise, this was not our solution. We did this again for all three-loops where each loop is one logical suite. That ran to completion and again, no solution– again to be expected; not yet long enough to accommodate the anticipated length of the solution.
One logical block became two, became three… and at each step, the base of the exponent to our magical induction grew.
Four logical blocks… we halted the experiment; the machine would’ve taken a month to finish that block.
The exponential explosion was real, and our bid that the solution may be just short enough to fit therein was proven false.
The Bottom Up Approach
Months passed, various members went on various summer excursions… and many have returned now. We discuss many theoretical approaches. We resample the problem, sniffing for hints. Actually, it’s been Andre, Jordan and me … we haven’t discussed this with the remaining modeling team yet because of just how vague our new lines of intrigue are. I will revise my opinion if the thought that more individuals means faster solution finding crosses my mind again.
I’ve had a few conversations, one with my MSc advisor, Stefan; one with a friend Andrew Baker; and another with my undergraduate project advisor, Bettina. So far, no one’s seen this specific problem before or can allude to either an approach, technology or research that they’ve seen…
We reformalize the problem with the following constraints as follows.
- Must deal with circularity of DNA, hence by circularly shift invariant
- Must accommodate or encapsulate reverse complementation
Intrigue
Several lines of intrigue we visit now.
First, Knot Theory– provides a representation for knots as real-valued vectors; unique shapes however may produce degenerate vectors. Knots allow us to take our loop of DNA and place the putative recombinatory hotspots one on top of another. Missing from this item is precisely how to dope the vectors with our own sequence data.
Second, Lambda Math and Logical Programming provide a language and a method respectively to map vectors from left to right. The form of the abductive equations for this problem are yet to be discovered however. We’re thinking about this method because we suspect that the recombinase enzyme activity can be completely expressed as a mathematical construct on our doped knot vectors. We hope that this construct can be expressed with abductive statements.
Third, Recombinatory Calculus– actually, this item is in stark competition with Logical Programming as the functional crux of the model. Recombinatory Calculus which is fairly distant from Recombinatorics, mind– is a math that has shown all other math functions can be constructed by just two atoms. If it turns out that the final representation of a DNA loop looks more like arguments for these two atoms, then we may pursue this– but at present, it seems to be losing against Logical Programming– the allure of the two atoms subsides as we realized the complexity for even the addition function for integers.
Direction
Luckily… roughly a dozen papers have been recovered from various repositories that discuss knot math and how to hack it sufficiently to kindly represent DNA loops. We continue to read and discuss these papers until we feel it reasonable to raise it with the entire modeling group… that is, when the science is done and the engineering begins anew.
Rather Hashing

Andre and Brandon
I’ve been away recently, so this task has apparently been uptaken by Jordan. The reverse-hashing integer-to-sequence function to be done for modeling was formalized a bit more in a meeting about two weeks ago, and I’ve yet to be briefed about what form it’s taken in yesterday’s meeting.
Update: Andre tells me that Jordan did in fact finish the sources, and everything ran overnight– however, the exponential explosion that we were afraid of ended up occurring; the present algorithm (part of which is described below) ran to the fourth iteration and well, would continue to run for a few weeks had it not been stopped… It looks like there’s ever more need for a working bottom-up approach…
Getting to absolute basics, this reverse hashing function converts positive integers to a sequence of arbitrary base strings– actually, I want to describe the general form of this function in case I need it in future. So if we know the size of the alphabet used for each character of a string, we can give each character a unique ordinal value. Two examples follow…

Brandon and Matthew
#Latin Alphabet (as used in English)
(A, 1), (B, 2), (C, 3), (D, 4) ... (Y, 25), (Z, 26), (null, 0)
#Nucleotides
(A, 1), (C, 2), (G, 3), (T, 4), (null, 0)
If we want to represent a string, we’d simply substitute the integer for the character.
#BADEGG
214577
#AGGCTT
133244

Bredth First Search Sphere
Bredth First Search Sphere [figure]… Andre used this chalkboard diagram to illustrate to Chong that this encoding conveniently increases in sequence length– we could consider this cardinality, or radius, or more importantly, the number of hops on a graph representation– when this problem is considered in lexicographic ordering, the implied algorithm is a bredth-first traversal.
We ran into a problem– this would at most represent one string. Brandon came up with a workaround, the notion of stealing characters from a sequence based on the modulus of its index! So, if we wanted to encode three strings, then every character at (index%3 = 0) belongs to string A. Strings B and C would then occupy (index%3 = 1) and (index%3 = 2) respectively.
Examples:
#Encode BADGE, FEED and AI together
#Pushes together as... BAA AEI DEx GDx Exx
#Where lowercase 'x' is null.
211159450740500
So that null symbols are inserted to preserve the correct location of each symbol.

3D 3Layer Cake
3D 3Layer Cake [figure]… An alternative approach to the encoding is to produce a triplet of integers instead of interweaving them; to farm out the sequences to be operated on, one would keep the entire domains of any two of the three sequences, while distributing the third; actually– this can still be done with the present encoding scheme, just farm out a fraction of the sequences based only on certain indexes of each sequence (the indexes satisfying the modulus math statements above). Abstractly, we can think of this as a three-dimensional cake where one dimension is distributed in layers– a three-serial-CPU-farm would consume a three-layered cake.
There’s one other thing I haven’t quite discussed, and that’s sequence sensitivity– Some sequences are masked so that the location of a certain integer implies a different entity depending on their position in their string– I’ll leave that for another post though.
I’ll have to discuss the bottom-up approach we’re going to try next– or not try at all since the modeling team is running very short on time; doing things by hand would either require inspiration, a marvel of human savant-like adduction or incredible luck… Jordan apparently demoed the algorithm by hand at the meeting I missed and showed the normal human mind can’t cope with the growth of the problem either…

Jordan playing a first person shooter...
Whoa, hold up: we ran the thing already? I have apparently fallen out of the loop.
I can’t say I’m really surprised that we ran into an exponential explosion. I had a feeling it would turn out this way when I tried to make a more useable UI and kept coming up with exploding test cases.
It looks like the easy solution’s pretty much killed off at this point. Time to break out the fun stuff?
Precisely — it’ll be a while though. In fact, keep your eyes open. If you come across some math that accommodates this problem well, figure out how we can use it.
Ed's Big Plans