edu.iastate.metnet.graphmodel
Class ChemicalReactionMetaphor

java.lang.Object
  extended by edu.iastate.metnet.graphmodel.AbstractGraphMetaphor
      extended by edu.iastate.metnet.graphmodel.ChemicalReactionMetaphor
All Implemented Interfaces:
IGraphMetaphor

public class ChemicalReactionMetaphor
extends AbstractGraphMetaphor

flux analysis on this

Author:
Jie Li

Field Summary
(package private)  java.lang.Integer currentBlockID
          current focus blockunit, if null, none is selected
(package private)  org.apache.commons.collections.map.MultiKeyMap currentBlockIDSubSystemMap
          since node is not always same hash I have to create another map say currentBlockIDSubSystemMap, the key is (blockid, blockunittype)
(package private)  java.lang.Object[] currentCells
          current graph cells in the jgraph instance
(package private)  org.jgraph.JGraph currentGraph
          current jgraph instance
(package private)  java.util.Map currentIntermediumMap
          hold the information of the intermedium compound the key is node->{blockid, incomingreactionids, outgoingreactionids, subsystem, }
(package private)  java.util.Map currentNodeSubSystemMap
          node and their corresponding sub-system-id
(package private)  java.util.Map currentValidEdgeMap
          edges covered by current chemical reaction set
(package private)  java.util.Map currentValidNodeMap
          current chemical reaction nodes and their substrate nodes
(package private) static org.apache.log4j.Logger logger
          log4j facility
(package private)  java.util.Map reactionRateMap
          hold the chemical reaction rates
(package private)  int subSystem
          current sub-system label, if 0, none is selected
 
Fields inherited from class edu.iastate.metnet.graphmodel.AbstractGraphMetaphor
DEFAULT_BACKGROUND, DEFAULT_FOREGROUND, DEFAULT_LINE_WIDTH
 
Constructor Summary
ChemicalReactionMetaphor()
           
 
Method Summary
 java.util.List collectInteractionIDListInSubSystem(java.lang.Integer subSystem)
          collect the interaction in the sub-system
 int computeDegreeOfFreedom(int totalChemicalReactionCount, int providedRateCount)
          compute the degree of the freedom of the linear equation system.
 java.lang.Integer getCurrentBlockID()
           
 org.apache.commons.collections.map.MultiKeyMap getCurrentBlockIDSubSystemMap()
           
 java.util.Map getCurrentIntermediumMap()
           
 java.util.Map getCurrentNodeSubSystemMap()
           
 java.util.Map getCurrentValidEdgeMap()
           
 java.util.Map getCurrentValidNodeMap()
           
 java.util.Map getReactionRateMap()
           
 int getSubSystem()
           
 void run(org.jgraph.JGraph graph, java.lang.Object[] cells)
          make the graph black and white
 void runGlobalMetaphor(org.jgraph.JGraph graph, java.lang.Object[] cells)
          label all valid interaction as red
 void runPartialMetaphor(org.jgraph.JGraph graph, java.lang.Object[] cells, int subSystem)
          visualize the selected sub-system, for simplicity, we only change the color of the node, and ignore all edges.
 void runSpecialMetaphor(org.jgraph.JGraph graph, java.lang.Object[] cells, java.lang.Integer selectedBlockID)
          metaphor the selection as blue
 void runSpecialMetaphor(org.jgraph.JGraph graph, java.lang.Object[] cells, java.util.Map reactionRateMap)
          change the width of the reaction based on the rate
 void setCurrentBlockID(java.lang.Integer currentBlockID)
           
 void setCurrentBlockIDSubSystemMap(org.apache.commons.collections.map.MultiKeyMap currentBlockIDSubSystemMap)
           
 void setCurrentNodeSubSystemMap(java.util.Map nodeSubSystemMap)
           
 void setCurrentValidEdgeMap(java.util.Map validEdgeMap)
           
 void setCurrentValidNodeMap(java.util.Map validNodeMap)
           
 void setReactionRateMap(java.util.Map reactionRateMap)
           
 void setSubSystem(int subSystem)
           
 
Methods inherited from class edu.iastate.metnet.graphmodel.AbstractGraphMetaphor
autoSizeBox, changeEdgeColor, changeEdgeDualColor, changeEdgePattern, changeEdgeWidth, changeVertexBackgroundColor, changeVertexBorderColor, changeVertexBorderWidth, changeVertexDualColor, changeVertexForegroundColor, getEdgeType, getIncomingEdges, getIncomingNodes, getInteractionColorForEdge, getInteractionWidthForEdge, getIntersectionNodes, getLocationColorForVertex, getOutgoingEdges, getOutgoingNodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger
log4j facility


subSystem

int subSystem
current sub-system label, if 0, none is selected


currentBlockID

java.lang.Integer currentBlockID
current focus blockunit, if null, none is selected


currentValidNodeMap

java.util.Map currentValidNodeMap
current chemical reaction nodes and their substrate nodes


currentValidEdgeMap

java.util.Map currentValidEdgeMap
edges covered by current chemical reaction set


currentNodeSubSystemMap

java.util.Map currentNodeSubSystemMap
node and their corresponding sub-system-id


currentBlockIDSubSystemMap

org.apache.commons.collections.map.MultiKeyMap currentBlockIDSubSystemMap
since node is not always same hash I have to create another map say currentBlockIDSubSystemMap, the key is (blockid, blockunittype)


currentGraph

org.jgraph.JGraph currentGraph
current jgraph instance


currentCells

java.lang.Object[] currentCells
current graph cells in the jgraph instance


reactionRateMap

java.util.Map reactionRateMap
hold the chemical reaction rates


currentIntermediumMap

java.util.Map currentIntermediumMap
hold the information of the intermedium compound the key is node->{blockid, incomingreactionids, outgoingreactionids, subsystem, }

Constructor Detail

ChemicalReactionMetaphor

public ChemicalReactionMetaphor()
Method Detail

setCurrentNodeSubSystemMap

public void setCurrentNodeSubSystemMap(java.util.Map nodeSubSystemMap)
Parameters:
nodeSubSystemMap - The nodeSubSystem to set.

setCurrentValidEdgeMap

public void setCurrentValidEdgeMap(java.util.Map validEdgeMap)
Parameters:
validEdgeMap - The validEdgeMap to set.

setCurrentValidNodeMap

public void setCurrentValidNodeMap(java.util.Map validNodeMap)
Parameters:
validNodeMap - The validNodeMap to set.

runGlobalMetaphor

public void runGlobalMetaphor(org.jgraph.JGraph graph,
                              java.lang.Object[] cells)
label all valid interaction as red


runPartialMetaphor

public void runPartialMetaphor(org.jgraph.JGraph graph,
                               java.lang.Object[] cells,
                               int subSystem)
visualize the selected sub-system, for simplicity, we only change the color of the node, and ignore all edges. we did not hold the subsystem for those edges

Parameters:
graph - the jgraph instance
cells - the graph cell in the jgraph instance
subSystem - the selected sub-system

runSpecialMetaphor

public void runSpecialMetaphor(org.jgraph.JGraph graph,
                               java.lang.Object[] cells,
                               java.lang.Integer selectedBlockID)
metaphor the selection as blue

Parameters:
graph - the jgraph instance
cells - the graph cells in the jgraph instance
selectedBlockID - the selected blockunit id

runSpecialMetaphor

public void runSpecialMetaphor(org.jgraph.JGraph graph,
                               java.lang.Object[] cells,
                               java.util.Map reactionRateMap)
change the width of the reaction based on the rate

Parameters:
graph -
cells -
reactionRateMap -

run

public void run(org.jgraph.JGraph graph,
                java.lang.Object[] cells)
Description copied from class: AbstractGraphMetaphor
make the graph black and white

Specified by:
run in interface IGraphMetaphor
Overrides:
run in class AbstractGraphMetaphor
Parameters:
graph - the jgraph instance
cells - the selected cells or all cells

getSubSystem

public int getSubSystem()
Returns:
Returns the subSystem.

setSubSystem

public void setSubSystem(int subSystem)
Parameters:
subSystem - The subSystem to set.

getCurrentNodeSubSystemMap

public java.util.Map getCurrentNodeSubSystemMap()
Returns:
Returns the nodeSubSystem.

getCurrentValidEdgeMap

public java.util.Map getCurrentValidEdgeMap()
Returns:
Returns the validEdgeMap.

getCurrentValidNodeMap

public java.util.Map getCurrentValidNodeMap()
Returns:
Returns the validNodeMap.

collectInteractionIDListInSubSystem

public java.util.List collectInteractionIDListInSubSystem(java.lang.Integer subSystem)
collect the interaction in the sub-system

Parameters:
subSystem - the subsystem
Returns:
the interaction id list

getCurrentBlockID

public java.lang.Integer getCurrentBlockID()
Returns:
Returns the currentBlockID.

setCurrentBlockID

public void setCurrentBlockID(java.lang.Integer currentBlockID)
Parameters:
currentBlockID - The currentBlockID to set.

getReactionRateMap

public java.util.Map getReactionRateMap()
Returns:
Returns the reactionRateMap.

setReactionRateMap

public void setReactionRateMap(java.util.Map reactionRateMap)
Parameters:
reactionRateMap - The reactionRateMap to set.

computeDegreeOfFreedom

public int computeDegreeOfFreedom(int totalChemicalReactionCount,
                                  int providedRateCount)
compute the degree of the freedom of the linear equation system. only zero degree system is determined and potentially solvable.

suppose

then
d = x - (y + z)

Parameters:
totalChemicalReactionCount - total checmical reaction count
providedRateCount - provided rate parameter count
Returns:
the degree of the freedom

getCurrentBlockIDSubSystemMap

public org.apache.commons.collections.map.MultiKeyMap getCurrentBlockIDSubSystemMap()
Returns:
Returns the currentBlockIDSubSystemMap.

setCurrentBlockIDSubSystemMap

public void setCurrentBlockIDSubSystemMap(org.apache.commons.collections.map.MultiKeyMap currentBlockIDSubSystemMap)
Parameters:
currentBlockIDSubSystemMap - The currentBlockIDSubSystemMap to set.

getCurrentIntermediumMap

public java.util.Map getCurrentIntermediumMap()
Returns:
Returns the currentIntermediumMap.