Biorithm  1.1
Public Member Functions | Protected Attributes | Friends
SetOfActiveNetworks Class Reference

The SetOfActiveNetworks class stores a set of ActiveNetworks, all of which share some property. More...

#include <active-networks.h>

Inheritance diagram for SetOfActiveNetworks:
SetOfNetworkLegos

List of all members.

Public Member Functions

void add (ActiveNetwork &anet)
void add (vector< ActiveNetwork > &nets)
void add (Itemset &itemset, unsigned int index)
void add (vector< Itemset > &itemsets)
void addCondition (string condition)
virtual void compareNetworkLegosToActiveNetworks ()
void computeBinaryMatrix (vector< vector< unsigned int > > &binaryMatrix, map< unsigned int, string > &rowNames, map< unsigned int, string > &columnNames, bool addComplements=false, set< unsigned int > *complementRows=NULL)
 Compute a binary matrix representing memberships of interactions in ActiveNetworks.
void computeEdgeBetweenessCentrality ()
void clearEdgeEnrichments ()
 Erase all computed information about edge enrichments in each active network. This method is useful when I want to try different enrichment algorithms in the same run.
void computeEdgeEnrichments (const MyAnnotations &annotations)
void computeEdgeSimilarityGraph (MyGraph &graph) const
void clearNodeEnrichments ()
 Erase all computed information about node enrichments in each active network. This method is useful when I want to try different enrichment algorithms in the same run.
void computeNodeWeights (const GEData &gedata)
MyNT computeMostSimilarEdges (const MyGraph &other, unsigned int &bestIndex) const
MyNT computeMostSimilarNodes (const MyGraph &other, unsigned int &bestIndex) const
void computeNodeBetweenessCentrality ()
void computeNodeCounts ()
void computeNodeSimilarityGraph (MyGraph &graph) const
void computePvalues (const MyHistogram &histogram)
void computeSNetwork ()
 Compute the "s"Network formed by the ActiveNetworks.
void computeUnion (string name, ActiveNetwork &unionActiveNetwork)
void computeUnion (string name)
void expand (const GEData &expression, string id, MyNT correlationThreshold)
vector< ActiveNetworkgetActiveNetworks ()
void getUnion (ActiveNetwork &unionActiveNetwork)
unsigned int getNumActiveNetworks () const
 Return the number of ActiveNetworks stored.
void printConditions (ostream &conditionStream)
void printEdges (ostream &edgeStream)
void printEdgeBetweenessCentrality (ostream &edgeCentralityStream)
void printEdgesItemset (ostream &itemsetStream, string id)
void printEdgeTypeCounts (ostream &edgeTypesCountStream)
void printEdgeEnrichments (ostream &edgeEnrichmentStream, ostream &edgeEnrichedFunctionStream)
void printEdgeWeightsHistograms (ostream &edgeWeightsHistogramStream, string fileName)
void printNodeEnrichments (ostream &nodeEnrichmentStream, ostream &nodeEnrichedFunctionStream, GeneOntology *go)
 Print tabular information on enriched functions annotating nodes in the active networks.
void processNodeEnrichments (ostream &processNodeEnrichmentsStream, const GeneOntology *go)
 Analyse patterns in the enriched functions annotating nodes in the active networks.
void printNodes (ostream &nodeStream)
void printNodeBetweenessCentrality (ostream &nodeCentralityStream)
void printNodeWeightsHistograms (ostream &nodeWeightsHistogramStream, string fileName)
void printStatistics (ostream &statStream)
void read (const vector< string > &activeNetworkFiles)
void read (string activeNetworkFile)
void readEdges (string edgesFile)
virtual void readMappingFromNetworkLegosToActiveNetworks (string nlsToRNsFile)
 This function is defined in SetOfActiveNetworks only because of an implementation detail in NetMan::processComputedActiveNetworks(). Ideally, this method should be defined only in SetOfNetworkLegos.
void readNodeEnrichedFunctions (string nodeEnrichedFunctionsFile)
void readNodeEnrichments (string nodeEnrichmentsFile)
void readNodes (string nodesFile, MyGraph &superGraph)

Protected Attributes

vector< ActiveNetwork_anets
map< string, unsigned int > _anetIdToIndex
ActiveNetwork _combinedAnet
map< MyEdge, MyNT > _edgeCentralities
map< MyNodeId, MyNT > _nodeCentralities
map< MyNodeId, vector< MyGraph * > > _nodeCounts

Friends

class SetOfNetworkLegos

Detailed Description

The SetOfActiveNetworks class stores a set of ActiveNetworks, all of which share some property.


Member Function Documentation

void SetOfActiveNetworks::add ( ActiveNetwork anet) [inline]

Add an ActiveNetwork.

void SetOfActiveNetworks::add ( vector< ActiveNetwork > &  nets) [inline]

Add multiple ActiveNetworks.

void SetOfActiveNetworks::add ( Itemset itemset,
unsigned int  index 
) [inline]

Add an ActiveNetwork stored as an Itemset.

Parameters:
[in]itemset,areference to the Itemset to be added.
[in]index,theindex of the ActiveNetwork, set/incremented by the caller.
void SetOfActiveNetworks::add ( vector< Itemset > &  itemsets) [inline]

Add multiple ActiveNetworks stored as Itemsets.

void SetOfActiveNetworks::addCondition ( string  condition) [inline]

Add condition to all the ActiveNetworks.

This function is defined in SetOfActiveNetworks only because of an implementation detail in NetMan::processComputedActiveNetworks(). Ideally, this method should be defined only in SetOfNetworkLegos.

Reimplemented in SetOfNetworkLegos.

void SetOfActiveNetworks::computeBinaryMatrix ( vector< vector< unsigned int > > &  binaryMatrix,
map< unsigned int, string > &  rowNames,
map< unsigned int, string > &  columnNames,
bool  addComplements = false,
set< unsigned int > *  complementRows = NULL 
)

Compute a binary matrix representing memberships of interactions in ActiveNetworks.

Parameters:
[out]binaryMatrix,atwo-dimensional vector of unsigned ints. Each row represents an ActiveNetwork and each column represents an interaction in an ActiveNetwork.
[out]rowNames,amap from the name of an ActiveNetwork to the row it corresponds to in binaryMatrix.
[out]columnNames,amap from a string representing an interaction to the column it corresponds to in binaryMatrix.
[in]addComplements,aboolean. If this variable is true, the method adds the complement of each ActiveNetwork's binary vector to binaryMatrix. The name of the corresponding row is the name of the ActiveNetwork prefixed by "complement-".
[out]complementRows,apointer to a set of unsigned ints. If addComplements is true and this variable is not NULL, the method adds the indices of the rows corresponding to the ActiveNetwork complements to this set.
Warning:
Invoke this method only after invoking SetOfActiveNetworks::computeUnion().
Note:
The running time of this method is $O(mn + m m)$, where $m$ is the total number of interactions in all the ActiveNetworks and $n$ is the number of ActiveNetworks.

For each interaction (edge) in the union of all ActiveNetworks, compute its betweenness centrality and store them internally.

Compute the functions enriched in the edges of each ActiveNetwork.

Parameters:
[in]annotations,functionalannotations for all the edges in the ActiveNetwork.

The method uses the set of all edges with functional annotations in the argument as the universal set.

Compute a graph representing the similarity of the edge sets of the ActiveNetworks.

The method constructs a graph where each node is an active network and the weight of each edge is the set similarity of the edge sets of the two active networks connected by the edge.

MyNT SetOfActiveNetworks::computeMostSimilarEdges ( const MyGraph other,
unsigned int &  bestIndex 
) const

Compute the ActiveNetwork most similar to other based on common edges.

Parameters:
[in]other,aninstance of MyGraph.
[out]bestIndex,theindex in the invocant of the most similar ActiveNetwork.
Returns:
the value of the similarity.
MyNT SetOfActiveNetworks::computeMostSimilarNodes ( const MyGraph other,
unsigned int &  bestIndex 
) const

Compute the ActiveNetwork most similar to other based on common nodes.

Parameters:
[in]other,aninstance of MyGraph.
[out]bestIndex,theindex in the invocant of the most similar ActiveNetwork.
Returns:
the value of the similarity.

Compute NetworkLegos based on the ActiveNetworks in the invocant. For each node in the union of all ActiveNetworks, compute its betweenness centrality and store them internally.

For each node, compute how many ActiveNetworks it appears in.

Compute a graph representing the similarity of the node sets of the ActiveNetworks.

The method constructs a graph where each node is an active network and the weight of each edge is the set similarity of the node sets of the two active networks connected by the edge.

Compute node weights in each ActiveNetwork.

Parameters:
[in]geData,areference to a gene expression dataset.
void SetOfActiveNetworks::computePvalues ( const MyHistogram histogram)

Compute p-values of ActiveNetworks from a histogram of densities in random networks.

Parameters:
[in]histogram,ahistogram of densities in ActiveNetworks computed in random networks.

Compute the "s"Network formed by the ActiveNetworks.

An "s"Network ("s" stands for "state", "stimulus", "stress", or what have you) is a network where nodes are ActiveNetworks and edges represent similarities between ActiveNetworks. This method constructs the minimum spanning tree of the complete graph connecting all ActiveNetworks.

Note:
The method computes the set similarity between the edge sets of each pair of ActiveNetworks and uses 1 - the similarity as the edge weight.
void SetOfActiveNetworks::computeUnion ( string  name,
ActiveNetwork unionActiveNetwork 
) [inline]

Compute the union of all ActiveNetworks.

Parameters:
[in]name,astring from which to form the name of the union.
[out]unionActiveNetwork, an instance of ActiveNetwork that will contain the union.
void SetOfActiveNetworks::computeUnion ( string  name)

Compute the union of all ActiveNetworks and store it internally.

Parameters:
[in]name,astring from which to form the name of the union.
void SetOfActiveNetworks::expand ( const GEData expression,
string  id,
MyNT  correlationThreshold 
)

Expand computed ActiveNetworks using edges with high correlation that are not in the wiring diagram.

Return the ActiveNetworks.

Parameters:
[out]_anets, a vector containing all the ActiveNetworks in the set.
void SetOfActiveNetworks::getUnion ( ActiveNetwork unionActiveNetwork) [inline]

Return the union of all ActiveNetworks.

Parameters:
[out]unionActiveNetwork, an instance of ActiveNetwork that will contain the union.

The method assumes that you have already invoked one of the versions of SetOfActiveNetworks::computeUnion().

void SetOfActiveNetworks::printEdgeWeightsHistograms ( ostream &  edgeWeightsHistogramStream,
string  fileName 
)

Print edge weight histograms to a file and run gnuplot on this file.

Parameters:
edgeWeightsHistogramStream,anoutput stream to print the histograms to. This stream must be a file stream.
fileName,thename of the file that the first parameter points to.
void SetOfActiveNetworks::printNodeWeightsHistograms ( ostream &  nodeWeightsHistogramStream,
string  fileName 
)

Print node weight histograms to a file and run gnuplot on this file.

Parameters:
nodeWeightsHistogramStream,anoutput stream to print the histograms to. This stream must be a file stream.
fileName,thename of the file that the first parameter points to.
void SetOfActiveNetworks::read ( const vector< string > &  activeNetworkFiles)

Read ActiveNetworks from a list of files.

Parameters:
[in]activeNetworkFiles,avector of strings.

See the documentation for ActiveNetworks::read(string) for more details.

void SetOfActiveNetworks::read ( string  activeNetworkFile)

Read ActiveNetworks from a file.

Parameters:
[in]file,thename of a file containing ActiveNetworks.

The file contains ActiveNetworks stored in "itemset" format. Each line describes a single ActiveNetwork.

void SetOfActiveNetworks::readEdges ( string  edgesFile)

Read edges in a set of ActiveNetworks from a file.

Parameters:
[in]edgesFile,atab-delimited file containing all the edges in the ActiveNetworks. Each line contains the identifier of an ActiveNetwork, the identifiers of the two nodes incident on the edge, and the type of the edge.
virtual void SetOfActiveNetworks::readMappingFromNetworkLegosToActiveNetworks ( string  nlsToRNsFile) [inline, virtual]

This function is defined in SetOfActiveNetworks only because of an implementation detail in NetMan::processComputedActiveNetworks(). Ideally, this method should be defined only in SetOfNetworkLegos.

Reimplemented in SetOfNetworkLegos.

void SetOfActiveNetworks::readNodeEnrichedFunctions ( string  nodeEnrichedFunctionsFile)

Read ActiveNetwork-node-enriched-function triples from a file.

Parameters:
[in]nodeEnrichedFunctionsFile,atab-delimited file previously output by invoking SetOfActiveNetworks::printNodeEnrichedFunctions().
void SetOfActiveNetworks::readNodeEnrichments ( string  nodeEnrichmentsFile)

Read ActiveNetwork-node-enriched-function p-values from a file.

Parameters:
[in]nodeEnrichmentsFile,atab-delimited file previously output by invoking SetOfActiveNetworks::printNodeEnrichments().
void SetOfActiveNetworks::readNodes ( string  nodesFile,
MyGraph superGraph 
)

Read nodes in a set of ActiveNetworks from a file.

Parameters:
[in]nodesFilea tab-delimited file containing all the nodes in the ActiveNetworks. Each line contains the identifier of an ActiveNetwork and the identifier of one nodes in that ActiveNetwork.
[in]superGraphan instance of MyGraph of which the ActiveNetworks are subgraphs.
Note:
For each set of nodes in nodesFile, the method will create an ActiveNetwork that is the subgraph of superGraph induced by the node set.

The documentation for this class was generated from the following files:
 All Classes Functions Variables Typedefs Friends