fr.umlv.gramofone.graphs
Class MyGraph

java.lang.Object
  extended by fr.umlv.gramofone.graphs.MyGraph
All Implemented Interfaces:
java.io.Serializable

public class MyGraph
extends java.lang.Object
implements java.io.Serializable

Manage the network (and the connected component of a graph are considered as MyGraphs too)

Author:
fsikora
See Also:
Serialized Form

Field Summary
protected static int IDEDGE
           
 
Constructor Summary
MyGraph(CyNetwork networkBrut, MyPattern pattern, Homologies homologies, int NDel, int NIns, GMTask task)
          Create a new MyGraph to manage the cytoscape network
MyGraph(int n, int m, MyPattern motif, int Ndel, int Nins)
          Create a new random network with n nodes and m edges.
 
Method Summary
 java.util.List<CyNode> computeNeighbours(java.util.List<CyNode> nodes)
          Return a list with CyNode wich are connected to nodes in the list nodes
 java.util.Set<java.lang.Integer> getColors(int node)
          Get the colors associated to this node
 java.util.LinkedList<MyGraph> getConnectedComponent()
          Get the list of connected components
 Edges getEdgeObject()
           
 java.util.HashSet<Edge> getEdges()
          Get a set with edges of the MyGraph
 int getNdel()
          Return the number of deletions allowed (updated after the apriori deletions)
 java.util.Set<java.lang.Integer> getNeighbors(int v)
          Get the neighbors of the node v in the MyGraph
 CyNetwork getNetwork()
          get the cynetwork of the MyGraph
 int getNins()
          Return the number of insertions allowed
 java.util.List<java.lang.Integer> getNodes()
          Return the list of nodes id in the graph
 java.util.Set<java.lang.Integer> getNodesOfThisColors(int color)
          return a set with all nodes with the color color
 java.util.HashSet<java.lang.Integer> getNodesWithoutColors()
          Get a set of nodes without colors in the MyGraph after the coloring
 CyNetwork getOriginalNetwork()
           
 MyPattern getPattern()
          Get the motif
 java.util.Set<java.lang.Integer> getPatternColorful()
          Get only different colors of the pattern
 java.util.Set<java.lang.String> getPreviouslyDeletedProteins()
          Get the set of proteins deleted before the computation (if there got no homologous in the network)
 int getSize()
          Return the number of nodes in the MyGraph
 SubGraphResult model2SubGraph(int[] model, java.lang.Number score, Constraints constraints)
          From the result of the pseudoBoolean resolution, extract the corresponding subgraph in Cytoscape
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IDEDGE

protected static int IDEDGE
Constructor Detail

MyGraph

public MyGraph(int n,
               int m,
               MyPattern motif,
               int Ndel,
               int Nins)
Create a new random network with n nodes and m edges.

Parameters:
n - nb of nodes in the random network
m - nb of edges in the random network
motif - pattern to search
Ndel - maximum number of deletions
Nins - maximum number of insertions

MyGraph

public MyGraph(CyNetwork networkBrut,
               MyPattern pattern,
               Homologies homologies,
               int NDel,
               int NIns,
               GMTask task)
Create a new MyGraph to manage the cytoscape network

Parameters:
networkBrut - network
pattern - motif to search
homologies - homologies between proteins
NDel - maximum number of deletions
NIns - maximum number of insertions
task - Cytoscape task
Method Detail

getNodes

public java.util.List<java.lang.Integer> getNodes()
Return the list of nodes id in the graph

Returns:

getSize

public int getSize()
Return the number of nodes in the MyGraph

Returns:

getPatternColorful

public java.util.Set<java.lang.Integer> getPatternColorful()
Get only different colors of the pattern

Returns:

getNodesOfThisColors

public java.util.Set<java.lang.Integer> getNodesOfThisColors(int color)
return a set with all nodes with the color color

Parameters:
color -
Returns:

getColors

public java.util.Set<java.lang.Integer> getColors(int node)
Get the colors associated to this node

Parameters:
node - graph node
Returns:
set of color associated

getEdges

public java.util.HashSet<Edge> getEdges()
Get a set with edges of the MyGraph

Returns:

getNeighbors

public java.util.Set<java.lang.Integer> getNeighbors(int v)
Get the neighbors of the node v in the MyGraph

Parameters:
v -
Returns:

getPreviouslyDeletedProteins

public java.util.Set<java.lang.String> getPreviouslyDeletedProteins()
Get the set of proteins deleted before the computation (if there got no homologous in the network)

Returns:

getEdgeObject

public Edges getEdgeObject()

getNdel

public int getNdel()
Return the number of deletions allowed (updated after the apriori deletions)

Returns:

getNins

public int getNins()
Return the number of insertions allowed

Returns:

getNetwork

public CyNetwork getNetwork()
get the cynetwork of the MyGraph

Returns:

getOriginalNetwork

public CyNetwork getOriginalNetwork()

getConnectedComponent

public java.util.LinkedList<MyGraph> getConnectedComponent()
Get the list of connected components

Returns:

getNodesWithoutColors

public java.util.HashSet<java.lang.Integer> getNodesWithoutColors()
Get a set of nodes without colors in the MyGraph after the coloring

Returns:

getPattern

public MyPattern getPattern()
Get the motif

Returns:

computeNeighbours

public java.util.List<CyNode> computeNeighbours(java.util.List<CyNode> nodes)
Return a list with CyNode wich are connected to nodes in the list nodes

Parameters:
nodes -
Returns:

model2SubGraph

public SubGraphResult model2SubGraph(int[] model,
                                     java.lang.Number score,
                                     Constraints constraints)
From the result of the pseudoBoolean resolution, extract the corresponding subgraph in Cytoscape

Parameters:
model - the assignation of variables in PseudoBoolean
score - the score of the resolution
constraints -
Returns:
a subgraph

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object