Showing posts with label prolog. Show all posts
Showing posts with label prolog. Show all posts

Tuesday, August 18, 2009

BioLogic: Logic Programming with Biological Parts

BioLogic is shaping up nicely.

Right now, I have a Perl program that takes all FASTA-formatted BioBricks provided by this page of the Parts Registry, scrapes additional information for each entry from the Parts Registry website, and puts it in a giant Prolog program.

When this program is loaded, you can query the knowledge base to get, say, the names of all the parts sharing the same part parameters as part with id number 9422:

?- parameters(Partname, Parameters),parameters(ThePart, Parameters),part_id(ThePart,9422).

Partname = 'BBa_I14016';
Partname = 'BBa_K0991107';
...
No.

Cool! From there it's only a small step to get additional information about the parts in question, pick the ones marked 'Group Favorite,' print out their DNA sequences, or get a link to the web page with information about obtaining the part (e.g. a page like this).

It seems to me this is already a neat tool that could help scientists interact and explore the parts database, based on their needs. Just a little work on getting it robust, opening web-pages in a browser window, and the nifty command-line tool is ready. Slap a UI on there (more work than it sounds, unfortunately), and it might actually be user-friendly.

But the real power of Logic Programming is not exploited with little steps like these. We plan on introducing rules into the program that allow it to reason about combining parts.

With just a few basic rules, it'll be possible to give the program a list of one or more parts we'd like to use, and have it return an entire ordered list of the parts and processes required to incorporate them. Several lists, in fact, leaving the final choice up to the scientist, but at least ensuring that - according to our basic rules - each entry in the list is possible.

Ok, so this step in the development of BioLogic is pretty neat - automating some of the reasoning the synthetic biologists need to do to ensure they end up with a functioning organism. Useful and handy, but not as far as we can push this technology.

By adding additional rules about the behavior of parts, the program will be able to generate a complete part sequence based on a list of desired behaviors supplied by a scientist. These rules would apply to what the program knows about each part - the semantic implications of different categories, the part parameters, etc. Specific rules applying to individual parts or part classes could also be added, providing even more detailed and subtle knowledge to the program.

Prolog provides two great benefits in addition to the core functionality described above.
One great thing about Prolog programs is that they don't simply return one "best" answer, unless you really want them to. They can generate a nearly limitless number of solutions, which in this case would give researchers ample opportunity to experiment with its answers and introduce rules to improve the program. The second great bonus is that you can ask Prolog to explain itself - that is, show its chain of reasoning. This feature can give greater insight into the program, how the parts function together, and any errors or limitations in the knowledge base. It also helps explain how Prolog comes up with surprising answers - which often happens, for better or for worse.

Most of this advanced work will have to be performed by synthetic biologists who understand the interaction between parts, chassis, DNA, and the enzymes involved. Anybody know someone who might be interested?

Tuesday, July 28, 2009

Brainstorm

Ok, update about irl stuff!

I'm in a period of change, renewal, and dynamic perspective shifts. Sweet! To me, it's all incredibly interesting, so I'll try to communicate to you not just the general facts, but hopefully also an intuitive sense of the events.

So: I'm on my last 3 days of work at my current job. Next week, I start as a software developer at Numeriek Centrum Groningen, developing some CAD software used in the ship industry. NUPAS CADMATIC, if you want to Google it; I found oodles of illegal copies of it to download, but not a single usergroup, email list, or active forum about it. Not sure what that means, but it's strange.

This doesn't quite seem an ideal time to work at a company such as this; the credit/banking pothole in the in the economy is severely affecting demand for transport ships - the lowest point of demand is expected sometime in 2010 - precisely at a time when the market is already saturated - flooded by an unprecedented boom that had been building for years. Why hire more engineers at a time when sales in the entire industry is going to crash? I'll tell you - it's a smart move when there's a giant list of new features you want to implement, when differentiating from competitors is key to making sales (new features == differentiation), and labor is cheap. Hopefully I will provide this shot of adrenaline. In the best case, the new job will boost my development skills in return, provide support in my extracurricular efforts, a richer social life, and unprecedented financial growth.

In the worst case, where the job isn't great, and the future is bleak, at least I got this: an 111% of my former salary, 150% of my former vacation time, 20% of my former commute time, and a local colleague/social network.

Increased vacation time and a reduced commute translates into lower stress and an ability to invest time and money into pet projects. <-- I need those.

It also swings me from doing automatic license plate recognition to CAD software. Great! It'll be refreshing! I received a book on "Ship Knowledge" to study up on the terminology and concepts relevant to the software (well, except for the C/C++, FORTRAN, and Python stuff, which I'm already familiar with...). A refreshed geest is more apt to spend effort on pet projects. <-- also needed!

Now I can combine all four ingredients necessary for a pet project: time! money! spirit! and... oh yea! SPACE!

Space is the fourth ingredient, which has also completely fallen into place. After years of renting and paying exorbitant sums to rich landowners and aristocrats, I connived Jessica(Bunneh) into looking at houses to purchase. In April we started looking, in May we finalized the arrangements, in June we moved in, and in July we finished getting it all nicely set up for a quality lifestyle. Still not quite done, of course - when are you ever? But I now live in a quiet neighborhood on the outskirts of Groningen, where I can bike to and from work and the city. The living room is a little bit Mediterranean-themed; the bedroom a cool Zen green; and we have a giant study with a 4-meter-wide desk that spans the room, custom hardwood shelves, deep brown walls, and a green leaf pattern as a border.

And we have the internet. Well - a connection to it, at least! Reliably 10mbps down, 1.5mbps up... not bad.

So even a place to work! Quite a shift from... everything I've had before, I suppose.

Alright - but what is all this I want to work on?
Good question! I'm really clueless myself at the moment (it's very late), so I'll just continue to stream-of-consciousness it out onto the blog.

First there's BookHarmony. I'd go into it, but suffice it to say that - once it works - Amazon, EBay, and Google would be interested in licenses. The idea is to match users with books they'll like by analyzing the contents of the books themselves. There's some swell clustering and other fun math in the scoring/matching algorithms, but the core of the development work there is going to be the natural language processing algorithms necessary for analyzing the books. Jessica is getting more involved with the Informatiekunde (Information Science/NLP) degree she's working on at the Rijksuniversiteit Groningen, so she'll do the brunt of the NLP work, I think. Boring parts of the project are: the website front-end, procurement of books and text, securing/licensing/business-i-fying software.

I want to clarify that when I say something is boring, I mean it is uninteresting to me. That may be because it's genuinely mind-numbingly dumb, but most likely because I think it's hard and difficult to learn, and simply can't be asked.

Ok, then there's this thing I'm working on with my brother Marcus (QuantumTroll). We want to develop a system that uses AI techniques to develop a physics-based control scheme for use in simulations (or computer games). So when a bird wants to go "forward", it doesn't just "go forward" and animate the wings (possibly with inverse kinematics and other fancy techniques), but actually flap the wings, adjust the tail, and clench the little bird-feet in an effort to move itself forward through the air. By applying a generous helping of neural networks and genetic algorithms, we should be able to produce something pretty awesome. Possibly supporting dynamic models (say - the bird broke a wing), context-based learning, and other cool stuff. We'll see.

Next, there's a fairly recent idea hashed out in broad outlines with Jessica:
* Take the Registry of Standardized Parts.
* Flippin' a - toss the parts into a Prolog program. Why not? They're all nice and well-defined, and follow set rules...
* And then - who knows? - flip out and do something like:
?- creature(eat_oil,multiply,emit_raspberry_smell).

Could then buy a couple of kits and follow the instructions in the output, sell it to Shell so they can clean up their latest spill.

Another project I've considered (especially during the house-purchasing-and-moving process) is a little mapping tripod. It sweeps the room with a laser and a couple of cheap CCD cameras and stores the images on a memory card. Read the contents of the card into the software, and you'll be presented with a full three-dimensional depiction of the entire room. It sports a little GPS unit, so you can even take snapshots of several rooms, and the software will automatically stitch them together. The program provides output in various formats so you can do interior design work in Google SketchUp, for example. Now that I'm writing this, it strikes me - the CAD software I'll be working on supports transforming point clouds to NURBS or other three-dimensional digital information - perhaps it'll even be useful in industrial settings!

On the topic of side projects that might behoove a work environment, I've been working on a program that trains a geometrical model of a type of license plate on the basis of measurements from thousands of images. I have designed an algorithm that'll be able to split sets of measurements into subsets - one for each type of license plate. That would save endless amounts of time, effort, and errors for Dacolian - now we have to do it by hand! But I haven't had the time to implement it. I'd still like to... and perhaps I can get paid for it. That'd be super - some money on the side. You know - for the drugs and hookers.

Now it gets really fun. Why don't we combine the projects? Some sample mashups:

BioProlog with LearnToWalk. Who knows what would happen, but the technologies can certainly work together. For example, taking the genetic algorithms and applying them to start and goal state descriptions instead of action sequences - here we might discover new types of things that we can make out of the parts. Types of things, like The Blob (which actually came from space), or something else entirely unimaginable.

LearnToWalk with BookHarmony. Anything is possible if we combine a library of literary analysis techniques (essentially all of state-of-the-art NLP) with a system that learns complex context-sensitive behaviors... perhaps it could work as some sort of editor for news or magazine articles - which often exhibit poor writing style. Combined with an information retrieval engine, it could perhaps even do rudimentary fact-checking - flagging suspect articles for a human to check. We are still the most intelligent beings on the planet.

NOTE: None of these project names - except for BookHarmony - are permanent (or even correct). They're just temporary nothings I used to refer to them in this post.

Anyway, so now I've talked about where I am, and what I plan to do. The story of where I was is even longer, so I'll save that for my book. Hey! It'd be cool to write a book! I should add that to my project list.

What I haven't done is tell any of the crazy stories of things that happened along the way. I'm talking near-fatal toxic gases, how the cat maffia operates in this neck of the woods, floating through a glittering galaxy of shining stars on the way from work, losing 750 euros worth of bicycles in a month, the role of the grotesque in my blog entries and art, what can happen when you decide to test bicycle brakes, a mysterious house party with a movie-level hangover, attempting to get internet access with KPN, lack of sleep and associated hallucinations, and my thoughts on the universe, time, infinity, intelligence, and purpose.

Although I live to help create a form of intelligence that will transcend our current capacity for thought far beyond into the unforeseeable future, these are the stories that make the hassle of life possible; that show that the presence of a self-aware entity - observing, considering its observations, and ultimately appreciating them - is worth something.