Frank Bergmann of the University of Washington last week blogged an interesting piece on Computational Tools for the Annotation of SBML Models. Within it, he attempted to use a library that I have developed, snappily titled libAnnotationSBML.
The basic premise of the library is to provide a unified interface to the vast array of resources from which one can extract terms to semantically annotate SBML models. Up until recently, most models in the systems biology field have suffered from an inability to decipher the terms within, with many components given three letter acronyms that even the author cannot easily interpret after a day or two.
Annotating models gets around this problem, providing a consistent set of terms / names which can greatly increase interoperability and facilitate model merging and automated parameterisation.
Anyways, the long and short of it was that the libAnnotationSBML library was a pig to build and contains next to no documentation. So thanks very much to Frank for pointing out some faults. I've repackaged much of it and hopefully by following the steps below, we should be able to do something(s) useful with it.
Step 1: install Java 6 JDK.
Step 2: install Apache Ant.
Step 3: install Apache Subversion.
Step 5: open your Terminal or Command Prompt of choice, navigate yourself to an appropriate directory and...
mkdir libAnnotationSbml
cd libAnnotationSbml
svn co https://mcisb.svn.sourceforge.net/svnroot/mcisb/mcisb-ontology .
This will download the source code. Then, for those of you viewing in Mac and (possibly - I've not tested it) Linux, try the following:
ant
For those of you on Windows (or others who have installed the libSBML jar file in a non-default location, type
ant -Dsbml=[DIRECTORY_IN_WHICH_SBMLJ.JAR_IS_INSTALLED]

mkdir libAnnotationSbml
cd libAnnotationSbml
svn co https://mcisb.svn.sourceforge.net/svnroot/mcisb/mcisb-ontology .
This will download the source code. Then, for those of you viewing in Mac and (possibly - I've not tested it) Linux, try the following:
ant
For those of you on Windows (or others who have installed the libSBML jar file in a non-default location, type
ant -Dsbml=[DIRECTORY_IN_WHICH_SBMLJ.JAR_IS_INSTALLED]
The JUnit tests are a necessary evil. The web services upon which the library relies periodically fall over, or - worse still - change their interface. Running the tests takes about ten minutes, but IMHO is time well spent. (It's not like you're doing the testing anyway...)
The new libAnnotationSBML.jar library should be located in your dist/lib directory. There should also be Javadocs in the dist/doc directory. Although, frankly, these are likely to be as comprehensive and watertight as an explanation from John Terry regarding why he was late for dinner again.
This jar contains all of libAnnotationSBML and the client classes for the various webservices that it utilises. So, what can we do with it?
At the request of Falko Krause (of semanticSBML fame and Humboldt University Berlin), I generated a small command line application that attempts to interpret MIRIAM terms that one would find in annotated SBML files, or to search for these terms from a text string.
To access this, type the following:
cd bin
./libAnnotationSBML search ChEBI g6p
This will contact the ChEBI web service and search its database for terms matching "g6p".
The results are returned (in this case) in JSON format. (XML was so noughties). The results are essentially as a map of ids to names:
[["urn:miriam:obo.chebi:CHEBI%3A17665","alpha-D-glucose 6-phosphate"]]
You can try this with other sources if you wish:
./libAnnotationSBML search KEGG Compound D-glucose 6-phosphate
[["urn:miriam:kegg.compound:C00668","alpha-D-Glucose 6-phosphate"],["urn:miriam:kegg.compound:C06369","2-Deoxy-D-glucose 6-phosphate"],["urn:miriam:kegg.compound:C00092","D-Glucose 6-phosphate"],["urn:miriam:kegg.compound:C01172","beta-D-Glucose 6-phosphate"]]
Note that the names of the source exactly match those in the MIRIAM Resources. (However, not all - in fact very few - have web services or search facilities associated with them. Searching these "dead" resources will return empty sets).
[]
So we can search for a term from a metabolite name, which can the be used to annotate an unannotated model. Once we have a term (from perhaps reading an annotated model), we can also query our web services:
./libAnnotationSBML getName urn:miriam:obo.chebi:CHEBI%3A17665
"alpha-D-glucose 6-phosphate"
I guess we know that already. Link for a user?
./libAnnotationSBML getLink urn:miriam:obo.chebi:CHEBI%3A17665
Many of these sources map themselves to one another. The getXrefs command can attempt to find these:
./libAnnotationSBML getXrefs urn:miriam:obo.chebi:CHEBI%3A17665
["urn:miriam:kegg.compound:C00668","http:\/\/www.iupac.org\/inchi\/#InChI=1\/C6H13O9P\/c7-3-2(1-14-16(11,12)13)15-6(10)5(9)4(3)8\/h2-10H,1H2,(H2,11,12,13)\/t2-,3-,4+,5-,6+\/m1\/s1\/f\/h11-12H"]
We maybe didn't know this. CHEBI:17665 cross-references KEGG Compound C00668. I wonder if that, in turn, cross-references CHEBI:17665?
./libAnnotationSBML getXrefs urn:miriam:kegg.compound:C00668
["urn:miriam:pubchem.substance:3937","urn:miriam:obo.chebi:CHEBI%3A17665","urn:miriam:3dmet:B01304"]
It does. It also provides links to the equivalent entry in both PubChem substance and 3dmet.
An obvious next step for this would be to hide it behind a RESTful web service, such that a call to...
http://libAnnotationSBML.org?command=getName¶meter=urn:miriam:obo.chebi:CHEBI%3A17665
...would return JSON-formatted data that could be immediately dropped into your web application of choice. Which would make all of these Java / ant / libSBML dependencies (and much of this blog post) redundant. I'll look into it.
However, this is just one simple, command-line tool. There are more far things in the library to utilise. ChEBI, KEGG Compound and PubChem terms can return formulae and InChI strings. UniProt terms can return sequences, taxonomy, encoding genes, maybe even phosphorylation sites. With "proper" ontologies such as ChEBI, we can explore the ontology hierarchy, such that we can also ask what "parents" or "children" G6P has, returning stereochemically-specific molecules and related molecules such as glucose itself.
Other tools exploit these this to provide "proper" applications. One of which is an annotation tool (think semanticSBML or Saint) that takes a non-annotated SBML file and uses the search facilities above to annotate compartments, metabolites and enzymes, based upon their name attribute:

I'll package this up and post more of this ramble then.
Finally, thanks to my buddies whose work I supplement. If you're interested, please read their papers:
- Annotation and merging of SBML models with semanticSBML. Krause F, Uhlendorf J., Lubitz T., Schulz M., Klipp E., Liebermeister W. Bioinformatics (2010) 26(3):421-422.
- Saint: a lightweight integration environment for model annotation. Lister AL, Pocock M, Taschuk M, Wipat A. Bioinformatics (2009) 25(22):3026-3027.
And maybe this one:
- libAnnotationSBML: a library for exploiting SBML annotations. Swainston N, Mendes P. Bioinformatics (2009) 25(17):2292-2293.


Very interesting!
ReplyDelete