This is a test version of Biostars. For the public version, visit https://www.biostars.org.
What Open Source Java Library Can I Use To Query Online, Free Databases In Which Pathways A Metabolite Is Participating?

What opensource Java solutions are available to query online pathway databases like KEGG (or BioMeta), MACiE and Brenda for the pathways a certain metabolite is available, for example, based on the InChI? Preferably, the library would have a good data model for the pathway information, possibly SMBL or RDF-based. What would the code look like to make such a query?

chemoinformatics java

1 answer

There is no explicit Brenda Java-API I know of, but kegg provides a jar-file which I recommend you don't use.

There is a solution anyhow, I have never used MACiE btw.

Both database provide a standard compliant web-services interface over SOAP messages. Web-services are a standardized way of language and system independent programmatic communication.

Both services have a WSDL file to describe the interface.

This description can be used to automatically generate client code using for example Axis2 a free open-source implementation of the SOAP protocol. IMHO this is the way to go.

So you will use Axis2 wsdl2code (or the Axis2 Eclipse-plugin) to generate exactly the free-open-source Java API you need.


A little edit and some issues from myself after having a look at the KEGG soap interface: As often, KEGG is a bit misbehaving, so what I answered above is the theory, it is true in principle, but....

  1. The databinding (mapping of xml-schema types to Java types) that seems to work is xmlbeans. The adb databinding gives an error. This is due to non-standard use of some structures in the wsdl.
  2. Below is some source code demonstrating how an axis2 interface with xmlbeans data binding can be used. The only glitch is I cannot tell, how to set or read the ArrayOfstring. This glitch is IMHO KEGG's fault because they did only test with Axis1.
  3. Alternatives if nobody knows a better solution, try Axis1 with the jar-file from KEGG or try the Brenda WSDL.

Example use of Axis2/xmlbeans generated classes. The principle is the same for Brenda:

package keggtest;

   import java.rmi.RemoteException;

   import kegg.soap.ArrayOfstring;
   import kegg.soap.GetPathwaysByGenesDocument;
   import kegg.soap.GetPathwaysByGenesResponseDocument;
   import kegg.soap.KEGGStub;
   import kegg.soap.GetPathwaysByGenesDocument.GetPathwaysByGenes;

   import org.apache.axis2.AxisFault;

public class keggclient {

    /**
     * @param args
     */
    public static void main(String[] args) {

        try {
            KEGGStub stub = new KEGGStub("http://soap.genome.jp/KEGG.wsdl");

            GetPathwaysByGenes getPathwaysByGenes = GetPathwaysByGenes.Factory
                    .newInstance();
            ArrayOfstring genesIdList = ArrayOfstring.Factory.newInstance();
            // add items to ArrayOfstring, but how?
            getPathwaysByGenes.setGenesIdList(genesIdList);
            GetPathwaysByGenesDocument get_pathways_by_genes = GetPathwaysByGenesDocument.Factory
                    .newInstance();
            get_pathways_by_genes.setGetPathwaysByGenes(getPathwaysByGenes);
            try {
                GetPathwaysByGenesResponseDocument res = stub
                        .get_pathways_by_genes(get_pathways_by_genes);
                System.err.println(res.getGetPathwaysByGenesResponse()
                        .getReturn());
            } catch (RemoteException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

        } catch (AxisFault e) {
            // TODO Auto-generated catch block

            e.printStackTrace();
        }

    }
}

And another edit, after trying the Brenda WSDL with axis2 wsdl2code, the result is not very promising: ...

SEVERE: The binding operation getKeggPathway is RPC/literal. The message parts for this operation must use the type attribute as specificed by WS-I Basic Profile specification (4.4.1). Message part, ecNumber, violatesthis rule. Please remove the element attribute and use the type attribute. ...

So, if somebody has a better answer, including asking the service providers to adhere to standards. Apologies for testing after answering....

Log in to answer this question.