Cyclone

Home | Architecture - Requirements - Installation - Tutorial - FAQ - | Sourceforge Project | References - About Us

Introduction
Cyclone is able to generate different kinds of graphs (metabolic, regulation) and to export them to Jung or Cytoscape for manipulation or visualisation. This page will explain how to Cyclone deals with networks.

Index
- Generating graphs using the Jung API and GraphML >
- Visualizing graphs with Cytoscape applied to the transcriptional regulation interaction network >
- Visualizing graphs with Cytoscape applied to the metabolite regulation network >
- Visualizing complex networks with Cytoscape applied to the combined regulatory, protein-protein interaction and metabolic network >

Generating graphs using the Jung API and GraphML ^
Jung is a Java tool that includes many graph algorithms. Manipulate a graph directly in Cyclone using the Jung API is easy.
    /**
     * Example 5a
     * Metabolic Graph : each node represents a metabolite or a reaction
     * build the grah, export it in graphml and draw it in a new window
     * mySQL is required
     */
    public static void TutorialEx5a(String myOrganism, int max) {
        String keySession = new String("cyclone");
        
        //Structure to store the tempory graph
        ArrayList> myPseudoGraph = new ArrayList>(); 
        
        //Ask for a DataAccessObject (Dao) to manipulate the generalized-reactions
        GeneralizedReactionsDao rdao = new GeneralizedReactionsDao(keySession);
        
        //Get all Reactions
        List myRxns = rdao.getAllObjectsByInstance(myOrganism,"|Reactions|");     
        //List myObNodes = new ArrayList();     
        // myObNodes.addAll(rdao.getAllObjectsByInstance(orgid,"|Reactions|"));
        
        int i=0;  
        //For each reaction, extract the left and right metabolites
        for(GeneralizedReactions myRxn  : myRxns){    
            System.out.println("Dealing with "+myRxn.getFrameId());
            List leftts = rdao.getValueList(myRxn.getLeftt());
            for(String metaboliteFrame : leftts){
                ArrayList myTmpEdge = new ArrayList();
                myTmpEdge.add(metaboliteFrame);
                myTmpEdge.add(myRxn.getFrameId());
                myPseudoGraph.add(myTmpEdge);
            }
            
            List rightts = myRxn.getRightt();
            for(Rightt metabolite : rightts){
                ArrayList myTmpEdge = new ArrayList();
                myTmpEdge.add(myRxn.getFrameId());
                myTmpEdge.add(metabolite.getValue());
                myPseudoGraph.add(myTmpEdge);
            }
            if(i==max){break;}else{i++;}
        }      
        
        //Export it in Graphml format
        Graphml myGraph2 = GraphmlServices.buildGraphML(max,"MetabolismNetwork of "+myOrganism,myPseudoGraph);
        String filexml2 = GraphmlServices.export2Xml(myGraph2,"Data/Graphs/GraphM
        L/"+myOrganism+"_metabolicnetwork"+(new Date()).getTime()+".xml");
        
        //Display it in a window using jung api
        GraphmlServices.displayGraph(filexml2);
    }
A Flash tutorial illustrates this step.
Flash Tutorial

Below is an extract of the output GraphML file corresponding to the Ecoli metabolic graph:

<?xml version"1.0" encoding"UTF-8" standalone"yes"?>
<graphml xmlns"http://graphml.graphdrawing.org/xmlns/1.0rc">
    <desc>MetabolismNetwork of Ecoli</desc>
    <graph parse.edges"5526" parse.nodes"2716" parse.order"free" edgedefault"directed" id"MetabolismNetwork of Ecoli">
        <node id"ACYL-ACP"/>
        <node id"1-ACYLGLYCEROL-3-P-ACYLTRANSFER-RXN"/>
        <edge id"ACYL-ACP_1-ACYLGLYCEROL-3-P-ACYLTRANSFER-RXN" source"ACYL-ACP" target"1-ACYLGLYCEROL-3-P-ACYLTRANSFER-RXN"/>
        <node id"ACYL-SN-GLYCEROL-3P"/>
        <edge id"ACYL-SN-GLYCEROL-3P_1-ACYLGLYCEROL-3-P-ACYLTRANSFER-RXN" source"ACYL-SN-GLYCEROL-3P" target"1-ACYLGLYCEROL-3-P-ACYLTRANSFER-RXN"/>
        <node id"ACP"/>
        <edge id"1-ACYLGLYCEROL-3-P-ACYLTRANSFER-RXN_ACP" source"1-ACYLGLYCEROL-3-P-ACYLTRANSFER-RXN" target"ACP"/>
        <node id"L-PHOSPHATIDATE"/>
        <edge id"1-ACYLGLYCEROL-3-P-ACYLTRANSFER-RXN_L-PHOSPHATIDATE" source"1-ACYLGLYCEROL-3-P-ACYLTRANSFER-RXN" target"L-PHOSPHATIDATE"/>
        <node id"GLUCONATE"/>
        <node id"1.1.1.215-RXN"/>
        <edge id"GLUCONATE_1.1.1.215-RXN" source"GLUCONATE" target"1.1.1.215-RXN"/>
This code will display a graph using the Jung API as shown below


Visualizing graphs with Cytoscape applied to the transcriptional regulation interaction network ^
Cyclone can be used to visualize graphs extracted from Cyclone data. Cyclone exports '.sif' files that can be read by Cytoscape. Below are some examples of screenshots of EcoCyc regulatory, proteic and metabolic graphs extracted from Cyclone data and displayed by Cytoscape.

This first example shows the transcriptional regulation interaction graph.
    /**
     * Example 5b
     * Transcriptional Regulation Interaction Graph: each node represents a gene
     * export the graph into Cytoscape format
     * mySQL is required
     */
    public static void TutorialEx5b(String myOrganism, int max) {
        String keySession = new String("cyclone");
        Regulation myRegulation = TranscriptionalRegulationCreator.getRegulation( keySession ,  myOrganism, max);
        //print in the console
        myRegulation.display();
        
        //Export it in Cytoscape format (SIF, NA)
        myRegulation.toCytoscape();
        
        //print it for NeMo clusters analysis tool
        //myRegulation.toClusterMatrix();        
    }
The resulting Cytoscape layout of the transcriptional regulatory network extracted from EcoCyc is shown below.
Activations are representing by green edges, inhibitions are representing by blue edges. Genes are represented by square. An arrow starting from a gene indicates that the gene product is a transcription factor, acting on the targeted genes.



Below is a zoom on the transcriptional regulatory network extracted from EcoCyc.





Visualizing graphs with Cytoscape applied to the metabolite regulation network ^
This is a second example. The following function extracts the metabolite regulation network.
    /**
    * Given an organism, this function extracts the metabolic regulation network
    * Foreach enzymaticreaction, extract the metabolites that inhibits/activates the enzyme
    * @param orgid
    * @param keySession
    * @return
     */
   private static Graphml getGraphml(String orgid,String keySession){
       Graphml myGraphml = null;
       ObjectFactory myObjectFactory = new ObjectFactory();
       Graph myGraph = null;
       HashMap myNodes = new HashMap();
       HashMap myEdges = new HashMap();
       try
       {
           myGraphml   = myObjectFactory.createGraphml();
           myGraphml.setDesc("Hard coded desc Ecoli.metabolicRegulation.network.graphml.xml");
           myGraph = myObjectFactory.createGraph();
           myGraph.setId("mr");
           myGraph.setParseOrder(TypeGraphOrderType.FREE);
           myGraph.setEdgedefault(TypeGraphEdgedefaultType.DIRECTED);
           myGraphml.getGraphOrData().add(myGraph);
           Key myKeyNodeType = myObjectFactory.createKey();
           myKeyNodeType.setId("NodeType");
           myKeyNodeType.setFor(TypeKeyForType.NODE);
           myKeyNodeType.setAttrName("nodetype");
           myKeyNodeType.setAttrType(TypeKeyTypeType.STRING);
           myGraphml.getKey().add(myKeyNodeType);
           Key myKeyEdgeType = myObjectFactory.createKey();
           myKeyEdgeType.setId("regulation");
           myKeyEdgeType.setFor(TypeKeyForType.NODE);
           myKeyEdgeType.setAttrName("regulationtype");
           myKeyEdgeType.setAttrType(TypeKeyTypeType.STRING);
            myGraphml.getKey().add(myKeyEdgeType);

       EnzymaticReactionsDao cdao = new EnzymaticReactionsDao(keySession);
       List myEnzymaticReactions = cdao.getListAllObjects(orgid);
       String framerxn;
       String myFrameActivator, myFrameInhibitor;
       int i=0;
       for(EnzymaticReactions myEnzymaticReaction : myEnzymaticReactions){
           framerxn =  ((Reaction)myEnzymaticReaction.getReaction().get(0)).getValue();
           List myActivators = myEnzymaticReaction.getActivatorsAll();
           for(ActivatorsAll myActivatorsAll :myActivators){
                   myFrameActivator = myActivatorsAll.getValue();
                   Node myNodeRxn = getNode(myGraph,framerxn,myNodes, myKeyNodeType, "rxn");
                   Node myNodeMet = getNode(myGraph,myFrameActivator,myNodes, myKeyNodeType, "metabolite");
                   String edgeName = myNodeMet.getId()+"_"+myNodeRxn.getId();
                   Edge myEdge = getEdge(myGraph,edgeName,myEdges,myKeyEdgeType,"active");
                   myEdge.setSource(myNodeMet);
                   myEdge.setTarget(myNodeRxn);              
           }                                          
           List myInhibitorsAlls = myEnzymaticReaction.getInhibitorsAll();
           for(InhibitorsAll myInhibitorsAll :myInhibitorsAlls){                 
                myFrameInhibitor = myInhibitorsAll.getValue();
                Node myNodeRxn = getNode(myGraph,framerxn,myNodes, myKeyNodeType, "rxn");
                Node myNodeMet = getNode(myGraph,myFrameInhibitor,myNodes, myKeyNodeType, "metabolite");
                String edgeName = myNodeMet.getId()+"_"+myNodeRxn.getId();
                Edge myEdge = getEdge(myGraph,edgeName,myEdges,myKeyEdgeType,"inhibe");
                myEdge.setSource(myNodeMet);
                myEdge.setTarget(myNodeRxn);                 }
                    // if(i==10){ break;}else{i++;}
           }
           myGraph.setParseNodes(BigInteger.valueOf(myNodes.size()));
           myGraph.setParseEdges(BigInteger.valueOf(myEdges.size()));
           System.out.println(myEdges.size());
       } catch (JAXBException e)
       {
           // TODO Auto-generated catch block
           e.printStackTrace();
       }
       return myGraphml;
   }
The output graphs visualized in Cytoscape are shown below.
This is the metabolite regulatory network extracted from EcoCyc representing by the 'spring' graph layout algorithm of Cytoscape. Metabolite can act as regulators of enzymatic activity.
Metabolite and reaction are representing by node. An arrow starting from a metabolite node indicates that this metabolite regulates the targeted enzymatic reaction node by inhibition or activation.


This is a zoom on the regulated metabolic network extracted from EcoCyc.




Visualizing complex networks with Cytoscape applied to the combined regulatory, protein-protein interaction and metabolic network ^
This third example shows the combined regulatory, proteic and metabolic graph.
    
    /**
     * Example 5c
     * Full Graph: 
     * each node can represent a gene, a reaction or a metabolite,
     * each link can represents transcriptional regulation, metabolite regulation, metabolite reaction
     * mySQL is required
     */
    public static void TutorialEx5c(String myOrganism, int max) {      
        FullNetwork.completeNetwork(myOrganism,  max);  
    }
This is the resulting combined regulatory, proteic and metabolic network extracted from EcoCyc representing by the 'circle' layout algorithm of Cytoscape.
Reactions are represented by square nodes. Metabolites are represented by circle nodes and genes by diamond nodes. Blue edges represent inhibition, green edges represent activation, red edge represent negative interaction, yellow edges represent positive interaction, black edges represent a reaction. Finally, white diamond shape represents catalyse, black arrow represents consumption or production.



Below is a zoom on the combined regulatory, proteic and metabolic network extracted from EcoCyc.




Home | Architecture - Requirements - Installation - Tutorial - FAQ - | Sourceforge Project | References - About Us

Genoscope SourceForge.net Logo © 2004-2006 Cyclone. All trademarks are the properties of their respective owners.
CPS is copyright by Serge Smidtas and Francois Le Fevre