KEGGtranslator API

Welcome to the API for KEGGtranslator, an application to translate KGML-formatted XML files to various output formats.

See:
          Description

Packages
de.zbit.graph The graph package of KEGGtranslator, which contains yFiles related classes that contain the view, look and feel or also functions and tools for graphs.
de.zbit.gui.prefs Contains all those GUI elements that allow the user to manipulate the Options of KEGGtranslator.
de.zbit.kegg The main package of KEGGtranslator, which contains the set of possible Options for its configuration and also the main class that starts the application, either in command-line or graphical mode.
de.zbit.kegg.ext Provides classes that are extensions of other classes (mainly from other projects or jars) that are required for the translation or visualization of KEGG to other formats.
de.zbit.kegg.gui Provides several methods for a graphical user interface that supports working with KEGGtranslator.
de.zbit.kegg.io Provides classes for reading KGML files and to translate their content to other data types, such as GraphML or the data structures of JSBML or yFiles.
de.zbit.util The utility package of KEGGtranslator, which contains helper classes that are most generic and do not fit into other packages.

 

Welcome to the API for KEGGtranslator, an application to translate KGML-formatted XML files to various output formats. Please, feel free to use and include KEGGtranslator in your own application. If you do so, please don't forget to cite us.

Examples of how to use the KEGGtranslator JAR in your application

1. Translating a KGML-formatted XML file to an SBML file:

    // Simple translation of KEGG file to SBML file
    AbstractKEGGtranslator<SBMLDocument> k2s = new KEGG2jSBML();
    k2s.translate("test.xml", "test.sbml.xml");
    

2. Reading, manipulating and translating KEGG pathways:

    // Read a KGML file to the internal KGML data structure
    // and generate a new SBML file.
    AbstractKEGGtranslator<SBMLDocument> k2s = new KEGG2jSBML();
    Pathway p = KeggParser.parse("test.xml").get(0);
    p.setTitle("I renamed the pathway to my own title!");
    k2s.translate(p, "test.sbml.xml");
    

3. Generating a JSBML data structure from a KGML document:

    // Read a KGML file and simply create a JSBML data structure
    // from it. This data structure can then be reused for further
    // operations.
    AbstractKEGGtranslator<SBMLDocument> k2s = new KEGG2jSBML();
    Pathway p = KeggParser.parse("test.xml").get(0);
    org.sbml.jsbml.SBMLDocument doc = k2s.translate(p);
    

4. Batch translation of directories:

    AbstractKEGGtranslator<SBMLDocument> k2s = new KEGG2jSBML();
    BatchKEGGtranslator batch = new BatchKEGGtranslator();
    batch.setOrgOutdir("input_directory");
    //Optional: batch.setChangeOutdirTo("output_directory");
    batch.setTranslator(k2s);
    batch.setOutFormat(Format.SBML);
    batch.parseDirAndSubDir();
    

5. Quick translation of KGML to GraphML:

    // Fast translation of a KGML to a GraphML file
    Translator.translate(
      KEGGtranslatorIOOptions.Format.GraphML,
      "test.xml", "test.graphML");
    

Main authors of this project: