The LIMPOPO MAGE-TAB Parser

The LIMPOPO MAGE-TAB Parser is a Java library intended as a simple one-stop solution for MAGE-TAB parsing, validating, and programmatic object modelling.

It comes equipped with an internal, thread safe object model that represents the IDF as listing of key/value pairs and SDRF as a comprehensive graph. The ADF component is represented as a hybrid graph and key/value pairs, reflecting the format.

LIMPOPO is MAGE-TAB compliant and provides support for parsing both the 1.0 and the current working draft of the 1.1 versions of the specification.

The LIMPOPO parser is very easy to use, requiring just a few lines of code to parse MAGE-TAB documents and check their compliance with the specification. The LIMPOPO object model can also easily be populated programmatically.

The parser is readily extensible using a plug-in mechanism to provide additional parsing functionality, validation, or the ability to convert MAGE-TAB documents into your own object model that follows (or overlaps with) the MAGE-TAB specification.

To get started using the LIMPOPO parser, see the code examples or the javadocs. For more information about extending the parser, see Extensions.

Installation

To use the MAGE-TAB parser in your own code, you can either download the parser binary directly here or configure a dependency on it using maven.

There are two versions - the basic version doesn't include any of the project's dependencies, and the "assembly" version comes with dependencies pre-bundled. If you use the basic version, you will need to include the required dependencies: these are listed here.

If you use Maven, you don't need to worry about dependency management - if you want to add a LIMPOPO as a dependency of your own Maven project, you can add the following repository to your pom.xml file:

  <repositories>
    <repository>
      <id>limpopo-repo</id>
      <name>Limpopo Mini-SF Repository</name>
      <url>http://limpopo.sourceforge.net/maven/repo</url>
    </repository>
  </repositories>

Then simply add a dependency on LIMPOPO like so:

  <dependencies>
    <dependency>
      <groupId>uk.ac.ebi.arrayexpress2</groupId>
      <artifactId>limpopo</artifactId>
      <version>1.1.3</version>
    </dependency>
  </dependencies>

There are several versions available. Check the Release Notes for more information.

Usage

To use the parser in you application is simple, just import the relevant package and declare some code similar to the following:

 MAGETABParser parser = new MAGETABParser();

 URL idfFileURL = new URL("file:///path/to/idf.file");
 MAGETABInvestigation investigation = parser.parse(idfFileURL);

You can then extract data from the investigation using various public fields, so for example:

 String title = investigation.IDF.investigationTitle;

Simple as that!

Typically, you'll want to parse from a URL (as shown) or a File. You can also parse from an input stream, although to do so requires some extra code to ensure the parser can resolve relative locations (e.g. for when the SDRF file is referenced from within the IDF input stream).

For more details, take a look at the Code Samples, or for more advanced features, including how to write data out, how to register a listener to track errors, and how to plug in a custom validator, see Extensions.