fr.umlv.gramofone.graphs
Class SubGraphResult

java.lang.Object
  extended by fr.umlv.gramofone.graphs.SubGraphResult
All Implemented Interfaces:
java.lang.Comparable<SubGraphResult>

public class SubGraphResult
extends java.lang.Object
implements java.lang.Comparable<SubGraphResult>

Manage a subgraph representing a solution

Author:
fsikora

Field Summary
static java.lang.String DELETION_KEY
           
static java.lang.String INSERTION_VALUE
           
 
Constructor Summary
SubGraphResult(java.util.List<CyNode> nodes, java.util.List<CyEdge> edges, java.util.List<java.lang.Integer> subIds, java.lang.Number score, MyGraph parentMyGraph, int[] model, Constraints constraints)
          Create a solution from this list of nodes and edges.
 
Method Summary
 int compareTo(SubGraphResult o)
          used to sort the results
 javax.swing.ImageIcon getImage()
          get an image with the good number of nodes but no the correct placement
 java.lang.StringBuilder getInformations(int rowIndex)
          Text informations writen in the result panel
 CyNetwork getNetwork()
          get the result cynetwork
 CyNetwork getNetworkWithNeighbor()
          get the cynetwork of the result with 1 neigbhourg
 java.util.HashMap<java.lang.String,java.lang.String> getResult2Pattern()
          get the result match between pattern and this result
 float getScore()
          get the score of this result
 void showView()
          show the network result
 void showViewNeighbor()
          Show the network with 1 neighbourg, and select the nodes in the result
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELETION_KEY

public static java.lang.String DELETION_KEY

INSERTION_VALUE

public static java.lang.String INSERTION_VALUE
Constructor Detail

SubGraphResult

public SubGraphResult(java.util.List<CyNode> nodes,
                      java.util.List<CyEdge> edges,
                      java.util.List<java.lang.Integer> subIds,
                      java.lang.Number score,
                      MyGraph parentMyGraph,
                      int[] model,
                      Constraints constraints)
Create a solution from this list of nodes and edges.

Parameters:
nodes - CyNodes in the solution
edges - CyEdges in the solution
subIds - list of id in the solution
score - score of the solution
parentMyGraph - MyGraph network parent of the solution
model - result of LPB solver
constraints - constraints used in the LPB solver
Method Detail

getScore

public float getScore()
get the score of this result

Returns:
a score

getImage

public javax.swing.ImageIcon getImage()
get an image with the good number of nodes but no the correct placement

Returns:
an image

getInformations

public java.lang.StringBuilder getInformations(int rowIndex)
Text informations writen in the result panel

Parameters:
rowIndex - index in the result panel
Returns:
a string to be printed

getNetwork

public CyNetwork getNetwork()
get the result cynetwork

Returns:
the cynetwork

getNetworkWithNeighbor

public CyNetwork getNetworkWithNeighbor()
get the cynetwork of the result with 1 neigbhourg

Returns:
the cynetwork

showView

public void showView()
show the network result


showViewNeighbor

public void showViewNeighbor()
Show the network with 1 neighbourg, and select the nodes in the result


getResult2Pattern

public java.util.HashMap<java.lang.String,java.lang.String> getResult2Pattern()
get the result match between pattern and this result

Returns:
a map where key are proteins in the result and value the corresponding proteins in the pattern (or 0 if insertion). On key is deletion.

compareTo

public int compareTo(SubGraphResult o)
used to sort the results

Specified by:
compareTo in interface java.lang.Comparable<SubGraphResult>