|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnct.networkblast.CompatColorCodingPathSearch<NodeType>
public class CompatColorCodingPathSearch<NodeType extends java.lang.Comparable<? super NodeType>>
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. |
static int |
NUM_PATHS_PER_NODE
|
Constructor Summary | |
---|---|
CompatColorCodingPathSearch(int size)
|
|
CompatColorCodingPathSearch(int size,
int numSols)
|
|
CompatColorCodingPathSearch(int size,
int numSols,
double epsilon)
|
Method Summary | |
---|---|
protected boolean |
checkConstraint(int count)
Checks if a given path contains at least one of the nodes in the constraint set. |
protected boolean |
consistentSegmentation(NodeType node,
int colorCombination)
Checks that the node is consistent with the segement indicated by the color combination (ie the number of bits). |
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. |
void |
setBeginNodes(java.util.Set<NodeType> beginSet)
This methods defines a set of nodes from which one must BEGIN every path. |
void |
setConstraint(java.util.Set<NodeType> constraintSet,
int minNodes,
int maxNodes)
Sets a constraint on a path such that the path must contain a node (or nodes) in the specified constraint set. |
void |
setEndNodes(java.util.Set<NodeType> endSet)
This methods defines a set of nodes from which one must END every path. |
void |
setSegments(java.util.Map<NodeType,java.lang.Integer> maxSegmentMap,
java.util.Map<NodeType,java.lang.Integer> minSegmentMap)
Sets the segments used for producing ordered paths. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static double DEFAULT_EPSILON
public static int NUM_PATHS_PER_NODE
Constructor Detail |
---|
public CompatColorCodingPathSearch(int size)
size
- the integer size of paths to search forpublic CompatColorCodingPathSearch(int size, int numSols)
size
- The lengths of the paths to search for.numSols
- The maximum number of solution paths PER NODE to return.public CompatColorCodingPathSearch(int size, int numSols, double epsilon)
size
- The lengths of the paths to search for.numSols
- The maximum number of solution paths PER NODE 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 |
---|
public void setConstraint(java.util.Set<NodeType> constraintSet, int minNodes, int maxNodes)
constraintSet
- The set of nodes that constrain the paths.minNodes
- The minimum number of nodes from the constraint set that must
exist in the path.maxNodes
- The maximum number of nodes from the constraint set that may
exist in the path.public void setSegments(java.util.Map<NodeType,java.lang.Integer> maxSegmentMap, java.util.Map<NodeType,java.lang.Integer> minSegmentMap)
maxSegmentMap
- A map of nodes to the maximum segment number the node
is allowed in.minSegmentMap
- A map of nodes to the minimum segment number the node
is allowed in.public void setBeginNodes(java.util.Set<NodeType> beginSet)
beginSet
- The set containing the beginning nodes.public void setEndNodes(java.util.Set<NodeType> endSet)
endSet
- The set containing the ending nodes.public java.util.List<Graph<NodeType,java.lang.Double>> searchGraph(Graph<NodeType,java.lang.Double> graph, ScoreModel<NodeType,java.lang.Double> scoreObj)
searchGraph
in interface SearchGraph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>
graph
- the Graph object to searchscoreObj
- the scoring object (ie algorithm) to use to determine the
the edgeweight between two nodes.
protected boolean checkConstraint(int count)
count
- The number of constrained nodes in the path.
protected boolean consistentSegmentation(NodeType node, int colorCombination)
node
- The node used whose segement is to be checked.colorCombination
- The bitmap that defines a color combination and
segment.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |