Thursday, September 24, 2009

Java OBO Parser

I've been task with importing a large OBO file into a database. However, I had trouble finding a parser pre-bundled as a set of JAR files. There is one Java OBO parser that exists but it lives within a much larger application found here:

http://www.geneontology.org/GO.java.obo.parser.shtml

He goes into some details about the writing some code, but isn't clear about which JAR files from the SVN source that are needed to get it working. Here I will provide the list of 3 JARs needed for a Java OBO parser:

For some sample code see below:


DefaultOBOParser parser = new DefaultOBOParser();
OBOParseEngine engine = new OBOParseEngine(parser);

String path = "C:/MPheno_OBO.ontology";
Collection paths = new LinkedList();
paths.add(path);
engine.setPaths(paths);

engine.parse();
To import the OBO file, I plan writing my own implementation of OBOParser for better memory usage.

Cheers,
Phil

No comments:

Post a Comment