nct.networkblast.search
Class ColorCodingPathSearch<NodeType extends java.lang.Comparable<? super NodeType>>

java.lang.Object
  extended by nct.networkblast.search.ColorCodingPathSearch<NodeType>
All Implemented Interfaces:
SearchGraph<NodeType,java.lang.Double>

public class ColorCodingPathSearch<NodeType extends java.lang.Comparable<? super NodeType>>
extends java.lang.Object
implements SearchGraph<NodeType,java.lang.Double>

This class implements a color coding algorithm to search for pathways of size n in a given graph using a scoring object. See: Scott, et al., 2005, Efficient Algorithms for Detecting Signaling Pathways in Protein Interaction Networks, Lecture Notes in Computer Science, vol. 3500.


Field Summary
static double DEFAULT_EPSILON
          The default epsilon value.
 
Constructor Summary
ColorCodingPathSearch(int size)
           
ColorCodingPathSearch(int size, int numSols)
           
ColorCodingPathSearch(int size, int numSols, double epsilon)
           
 
Method Summary
 java.util.List<Graph<NodeType,java.lang.Double>> searchGraph(Graph<NodeType,java.lang.Double> graph, ScoreModel<NodeType,java.lang.Double> scoreObj)
          This function searches for pathways in the given graph of size pathSize using scoreObj and the color coding algorithm described by Scott, et al, 2005, Efficient Algorithms for Detecting Signaling Pathways in Protein Interaction Networks, Lecture Notes in Computer Science, vol 3500.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_EPSILON

public static double DEFAULT_EPSILON
The default epsilon value. Epsilon is probability that we will miss a best path if we iterate the correct number of times.

Constructor Detail

ColorCodingPathSearch

public ColorCodingPathSearch(int size)
Parameters:
size - the integer size of paths to search for

ColorCodingPathSearch

public ColorCodingPathSearch(int size,
                             int numSols)
Parameters:
size - The lengths of the paths to search for.
numSols - The maximum number of solution paths to return.

ColorCodingPathSearch

public ColorCodingPathSearch(int size,
                             int numSols,
                             double epsilon)
Parameters:
size - The lengths of the paths to search for.
numSols - The maximum number of solution paths to return.
epsilon - The probability that we won't find a best path. The lower the probability, the longer this algorithm takes, however the length increases logarithmically, so .01 isn't orders of magnitude faster than .0000001. SECRET FEATURE: If the value of epsilon is greater than 1, then we'll instead use that (integer) number as the number of iterations for the algorithm instead of rigorously calculating the number of iterations. This is an easy way of speeding up this search. Since the majority of of best paths are found in the first several iterations, this is a simple heuristic. Remember: you WILL miss best paths using this technique. Any value X where 1 < X < 20 will emit a warning indicating that the number of iterations you have selected is too small (although the algorithm will still run). In summary, if you've got the time, be rigorous and use a small epsilon (e.g. .00001), if not, then use a reasonable number of iterations (e.g. 20).
Method Detail

searchGraph

public java.util.List<Graph<NodeType,java.lang.Double>> searchGraph(Graph<NodeType,java.lang.Double> graph,
                                                                    ScoreModel<NodeType,java.lang.Double> scoreObj)
This function searches for pathways in the given graph of size pathSize using scoreObj and the color coding algorithm described by Scott, et al, 2005, Efficient Algorithms for Detecting Signaling Pathways in Protein Interaction Networks, Lecture Notes in Computer Science, vol 3500.

Specified by:
searchGraph in interface SearchGraph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>
Parameters:
graph - the Graph object to search
scoreObj - the scoring object (ie algorithm) to use to determine the the edgeweight between two nodes.
Returns:
a List of Graph objects that represent the found paths, or null if the given arguments are invalid.