Gene Ontology and Object Oriented Programming

The Gene Ontology (GO, http://www.geneontology.org) project is one that seeks to “standardize the representation of gene and gene product attributes across species and databases.” The way they do this is by creating a directed acyclic graph representing the functions and relationships of specific genes. Each node passed through increases the specificity of the child node. This is vaguely similar to how inheritance in object orientated programming.

In object oriented programming, inheritance promotes code reuse without duplication. The way this works (briefly) is, a base class is created containing methods and variables that classes could inherit from it. For example, if you were modeling vehicles, you could have a Vehicle class, which contains methods like move(), stop(), etc. and variables like moveSpeed, passengers, etc. This comes in handy when you make different types of vehicles like Bikes, Cars, and Trains. When you do that, you can inherit the methods like move() and stop() as well as the variables like moveSpeed and passengers. Thus, you only have to write those methods and variables once in the base Vehicle class. This image may be of help in visualizing it:

This is nice and tidy way of representing the world, only the world doesn’t exactly work like that. A great example is here, which explains how some of the principles of object oriented programming break down in video game programming.

The point is, not all objects can be placed in hierarchies with inheritance; sometimes you have groups that just don’t fit in anywhere and this turns the beautiful directed acyclic graph of inheritance into an ugly mess.

Back to gene ontologies, when storing our information about genes in a hierarchical manner, it’s possible that not all genes inherit the same properties as the nodes above it. However, I believe that GO has gotten around that by defining different relationships between nodes. For example, in this GO term, there are several relationships between nodes: is a, has part, is part, etc.

It’s possible that a similar method of inheritance could fix some broken models produced by objected oriented inheritance, but I don’t know of any languages that implement this fully (I also have not looked very much).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s