procope.data.networks
Class NetworkGenerator

java.lang.Object
  extended by procope.data.networks.NetworkGenerator

public class NetworkGenerator
extends Object

Contains static methods to generate networks from scores calculators or random networks.

This class is not instantiatable.

Author:
Jan Krumsiek

Method Summary
static ProteinNetwork generateNetwork(ScoresCalculator calculator)
          Generate a network from a given scores calculator.
static ProteinNetwork generateNetwork(ScoresCalculator calculator, float cutOff)
          Generate a network from a given scores calculator.
static ProteinNetwork generateRandomNetwork(int nodes, int edges)
          Generates a random network with the given number of nodes and edges.
static ProteinNetwork generateRandomNetwork(int nodes, int edges, Random random)
          Generates a random network with the given number of nodes and edges.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

generateNetwork

public static ProteinNetwork generateNetwork(ScoresCalculator calculator)
Generate a network from a given scores calculator. All proteins which are contained in the calculator will also be present in the network.

Parameters:
calculator - scores calculator from which the network will be calculated
Returns:
generated network

generateNetwork

public static ProteinNetwork generateNetwork(ScoresCalculator calculator,
                                             float cutOff)
Generate a network from a given scores calculator. All proteins which are contained in the calculator will also be present in the network.

Parameters:
calculator - scores calculator from which the network will be calculated
cutOff - only write scores greater than or equal to this value to the network
Returns:
generated network

generateRandomNetwork

public static ProteinNetwork generateRandomNetwork(int nodes,
                                                   int edges)
Generates a random network with the given number of nodes and edges. Each random edge is created by choosing two random nodes which are not yet connected. Each edge has a random weight between 0 and 1. This method uses Tools.random for random number generation.

Parameters:
nodes - number of nodes in the random network
edges - number of edges in the random network
Returns:
the randomly generated network

generateRandomNetwork

public static ProteinNetwork generateRandomNetwork(int nodes,
                                                   int edges,
                                                   Random random)
Generates a random network with the given number of nodes and edges. Each random edge is created by choosing two random nodes which are not yet connected. Each edge has a random weight between 0 and 1. Uses a caller- supplied random number generator.

Parameters:
nodes - number of nodes in the random network
edges - number of edges in the random network
random - random number generator to be used
Returns:
the randomly generated network