nct.networkblast.search
Class GreedyComplexSearch<NodeType extends java.lang.Comparable<? super NodeType>>
java.lang.Object
nct.networkblast.search.GreedyComplexSearch<NodeType>
- All Implemented Interfaces:
- SearchGraph<NodeType,java.lang.Double>
public class GreedyComplexSearch<NodeType extends java.lang.Comparable<? super NodeType>>
- extends java.lang.Object
- implements SearchGraph<NodeType,java.lang.Double>
This class implements the SearchGraph interface. It implements the
greedy search algorithm described in the supplemental material of
Sharan, et al. 2005. "Conserved patterns of protein interaction in
mulitple species." PNAS, 102(6),1974-1979.
Complexes are defined as branched or unbranched pathways invovling
minSeedSize or more nodes.
Constructor Summary |
GreedyComplexSearch(int minSize,
int maxSize)
Sets the max and min sizes for complexes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GreedyComplexSearch
public GreedyComplexSearch(int minSize,
int maxSize)
- Sets the max and min sizes for complexes.
- Parameters:
minSize
- Minimum complex size, also the size of the secondary seeds.maxSize
- Maximum allowed complex size.
searchGraph
public java.util.List<Graph<NodeType,java.lang.Double>> searchGraph(Graph<NodeType,java.lang.Double> graph,
ScoreModel<NodeType,java.lang.Double> scoreObj)
- Search the graph for a complex between minSeedSize and maxComplexSize
nodes in size.
The algorithm uses two sets of seeds. First it utilizes the list of
paths (if any) already found in the path search.
Second, it iterates over all nodes in the input graph and builds
seeds of size minSeedSize around each node by adding the node's
best neighbors to the seed. "Best" is defined as the sum of the scores
returned from the scoreObj. Once the seed is constructed, it is
appened to the overall list of seeds.
Now begin the greedy construction of complexes.
Given each seed, see if adding or removing 1 *new* node (seed
nodes are invariant and can't be removed) will increase the score,
and then do the corresponding action. Continue until the network cannot
add/delete any nodes that increase the score or the complex grows until
maxComplexSize.
- Specified by:
searchGraph
in interface SearchGraph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>
- Parameters:
graph
- The Graph object to search for complexes.scoreObj
- The score algorithm to use.
- Returns:
- The list of complexes found.
setSeeds
public void setSeeds(java.util.List<Graph<NodeType,java.lang.Double>> seeds)