edu.uconn.mcb.lineageevolver.graph
Interface GraphTopology

All Superinterfaces:
DirectedGraph
All Known Implementing Classes:
EdgeListGraphTopology

public interface GraphTopology
extends DirectedGraph

Common interface for graph objects to be used as topologies.

Author:
Hasan Khalil

Method Summary
 void addEvent(GenomeVisitor v, GraphEdge edge, int time)
          Adds an event to a given edge, provided a time interval and a GenomeVisitor.
 void applyEvent(GraphTopologyEvent event, Lineage l)
          Applies an event to a Lineage.
 GraphEdge getEdge(GraphTopologyEvent event)
          Returns the edge associated to a given event.
 GraphTopologyEvent getEvent(GraphEdge e)
          Returns the next event on the given edge corresponding to the current position on that edge.
 Genome getGenome(GraphNode v)
          Returns genome stored in the given node.
 java.lang.String getName(GraphNode v)
          Returns the name of the given node.
 int nextEventTime(GraphEdge e)
          Gets the evolutionary distance between the current position and the next event on the given edge, in time intervals.
 void setGenome(GraphNode v, Genome g)
          Sets the genome for a given node.
 void setName(GraphNode v, java.lang.String name)
          Sets the name for a given node.
 void setSubstitutions(GraphEdge e, int substitutions)
          Sets the branch length for the given edge.
 void setTime(GraphEdge e, int time)
          Sets the time associated to the given edge.
 void substitute(GraphEdge e, int time)
          Processes substitution on a given edge for a given amount of time.
 float substitutionsPerTime(GraphEdge e)
          Returns the number of substitutions per time interval for the given edge.
 
Methods inherited from interface edu.uconn.mcb.lineageevolver.graph.DirectedGraph
addEdge, addNode, getAdjacentNodes, getData, getData, getEdges, getNodes, getNodes, setData, setData
 

Method Detail

nextEventTime

public int nextEventTime(GraphEdge e)
Gets the evolutionary distance between the current position and the next event on the given edge, in time intervals.

Parameters:
e - the edge on which to operate.
Returns:
the number of time intervals between the current position and the next event on the given edge.

substitutionsPerTime

public float substitutionsPerTime(GraphEdge e)
Returns the number of substitutions per time interval for the given edge.

Parameters:
e - the edge on which to operate.
Returns:
the number of substitutions per time interval for the given edge.

getEvent

public GraphTopologyEvent getEvent(GraphEdge e)
Returns the next event on the given edge corresponding to the current position on that edge.

Parameters:
e - the edge on which to operate.
Returns:
the next event on the given edge.

addEvent

public void addEvent(GenomeVisitor v,
                     GraphEdge edge,
                     int time)
Adds an event to a given edge, provided a time interval and a GenomeVisitor.

Parameters:
v - the GenomeVisitor encapsulating the functionality for the newly generated event.
edge - the edge to which the event should be added.
time - the number of time intervals along the given edge that should be processed before the newly generated event is processed.

getEdge

public GraphEdge getEdge(GraphTopologyEvent event)
Returns the edge associated to a given event.

Parameters:
event - the event whose edge should be returned.
Returns:
the edge corresponding to the given event.

applyEvent

public void applyEvent(GraphTopologyEvent event,
                       Lineage l)
Applies an event to a Lineage.

Parameters:
event - the event to apply.
l - the Lineage to which the event is applied.

getGenome

public Genome getGenome(GraphNode v)
Returns genome stored in the given node.

Parameters:
v - the node for which to retrieve the genome.
Returns:
the genome inside the specified node.

getName

public java.lang.String getName(GraphNode v)
Returns the name of the given node.

Parameters:
v - the node for which to return the name.
Returns:
the name of the specified node.

setGenome

public void setGenome(GraphNode v,
                      Genome g)
Sets the genome for a given node.

Parameters:
v - the node in which to store the provided genome.
g - the genome to store in this node.

setName

public void setName(GraphNode v,
                    java.lang.String name)
Sets the name for a given node.

Parameters:
v - the node for which to set the name.
name - the new name for the provided node.

substitute

public void substitute(GraphEdge e,
                       int time)
Processes substitution on a given edge for a given amount of time.

Parameters:
e - the edge on which to process substitutution.
time - the amount of time to process substitution for.

setSubstitutions

public void setSubstitutions(GraphEdge e,
                             int substitutions)
Sets the branch length for the given edge.

Parameters:
e - the edge for which to set the number of substitutions.
substitutions - the number of substitutions to set for the given edge.

setTime

public void setTime(GraphEdge e,
                    int time)
Sets the time associated to the given edge.

Parameters:
e - the edge for which to set the number of time intervals.
time - the number of time intervals to set for the given edge.