Biorithm  1.1
Public Member Functions | Public Attributes
NetMan Class Reference

The NetMan class is a "manager" that controls the behaviour of the active-networks software by reading and storing command-line options and dispatching appropriate actions. More...

#include <netman.h>

List of all members.

Public Member Functions

virtual void setParameters (int argc, char **argv)
 Set internal parameters based on command line arguments.
void setComputeBetweennessCentralities ()
bool getComputeBetweennessCentralities () const
void setOBOFile (char *file)
void setClassFile (string name)
string getClassFile (void) const
void setCorrelationThreshold (float arg)
bool getComputeNetworkLegoStability () const
void setUseRandomisedGEData ()
bool getUseRandomisedGEData () const
string getCorrelationMethod () const
MyNT getCorrelationThreshold () const
void addDirectory (char *dir)
unsigned int getNumDirectories () const
string getDirectory (unsigned int index) const
void setComputeDenseFunctions ()
bool getComputeDenseFunctions () const
void setActiveNetworksEdgesFile (string file)
 Set the name of the file containing the edges in ActiveNetworks.
string getActiveNetworksEdgesFile () const
 Get the name of the file containing the edges in ActiveNetworks.
bool getProcessComputedActiveNetworks () const
 Return true if I am processing a previously computed file of active network or network lego nodes or edges.
string getExperimentName () const
void setNodeAnnotationsFile (char *name)
void setGEfile (char *name)
string getGEfile (void) const
void addIgnoredEdgeType (string type)
bool getComputeActiveNetworks (void) const
void setComputeNetworkLegos ()
bool getComputeNetworkLegos () const
bool setFunctionSubgraphsFile (string arg)
void setMultipleHypothesesCorrectionTest (string optarg)
LIBENRICHMENT_TEST_TYPE getMultipleHypothesesCorrectionTest () const
void setMinNumberConditions (unsigned int min)
unsigned int getMinNumberConditions () const
void setMinNumberInteractions (unsigned int min)
unsigned int getMinNumberInteractions () const
void setNetworkFile (char *file)
string getNetworkFile (void) const
void setActiveNetworksNodesFile (string file)
 Set the name of the file containing the nodes in ActiveNetworks.
string getActiveNetworksNodesFile () const
 Get the name of the file containing the nodes in ActiveNetworks.
bool getProcessNetwork () const
 Return true if I should simply process an interaction network.
string getLayoutConstraintsFile () const
void setPvalueThreshold (float thresh)
MyNT getPvalueThreshold () const
bool getComputePathwayPerturbation () const
void setNumRandomRuns (unsigned int num)
void setOnlyRandomRuns ()
bool getOnlyRandomRuns () const
unsigned int getNumRandomRuns () const
MyNT getRegulationBound () const
MyNT getUpRegulationBound () const
MyNT getDownRegulationBound () const
string getRegulationMethod () const
unsigned int getSimulatedAnnealingFactorNumberIterations () const
bool getSparsifyNetwork () const
string getSparsificationMethod () const
void setSplitActiveNetworksIntoComponents ()
bool getSplitActiveNetworksIntoComponents () const
bool getSplitGEData () const
void setEdgeWeightThreshold (string optarg)
void setEdgeWeightThreshold (MyNT thresh)
MyNT getEdgeWeightThreshold () const
void setUseStudentsTDistribution ()
bool getUseStudentsTDistribution () const
bool getTranslateAnnotations () const
bool getComputeTrivialNetworkLegos () const
void setExpandActiveNetworks ()
bool getExpandActiveNetworks () const
void setComputeActiveNetworksTillTheBitterEnd ()
bool getComputeActiveNetworksTillTheBitterEnd () const
bool getEmbedActiveNetworkInSuperGraph () const
bool getCreateWebPages () const
void createWebPages (SetOfActiveNetworks &anetSet)
 Create web pages describing ActiveNetworks, NetworkLegos, the genes and interactions in them, the functions enriched in them, and containing their layouts.
string getWWWParametersDir () const
void getWiringDiagram (MyGraph &wd)
 Return the wiring diagram.
void getWiringDiagramNodes (set< string > &nodes) const
 Return the set of nodes in the wiring diagram.
string getEdgeAnnotationsFile (void) const
 Return the name of the file containing annotations for edges/interactions.
void getNodeAnnotationsFiles (vector< string > &files) const
string getNodeAnnotationsFile (unsigned int index) const
unsigned int getNumNodeAnnotationsFiles () const
string getNodeAliasFile () const
 Return the name of the file containing node aliases.
string getFunctionSubgraphsFile () const
string getOBOFile (void) const
string getTreatmentControlFile () const
 Return the name of the file containing treatment-control pairs.
void readEdgeAnnotations (string name)
 Read functional annotations for edges/interactions from a file.
void readNodeAliases (string file)
void readNodeAnnotations (string name, set< string > *geneSet=NULL)
void readOBO (string name)
bool readFunctionSubgraphs (string)
bool readGEData (string)
bool readNetwork (string, MyNT minimumEdgeWeight=0)
vector< SetOfPPNodeStats > treatAliases (MyGraph &pathway, const GEData &geData)
bool allowNegativeEdgeWeight (set< string > &types) const
void computeDenseFunctions (ostream *fstr, map< string, MyGraph > &denseFunctionSubgraphs)
void computeDenseFunctions (ostream *fstr=NULL)
void computePathwayPerturbation ()
 Compute the perturbation of each pathway in each treatment-control gene expression data set pair.
void computePathwayPerturbation (const map< string, set< string > > &treatmentControlPairs, map< string, MyGraph > &pathways)
 Compute the perturbation of multiple pathways for a set of contrasts.
void computePathwayPerturbation (MyGraph &pathway, const GEData &treatment, const GEData &control, string contrast, ActiveNetwork &subgraph)
 Compute the perturbation of pathway in the treatment-control gene expression data set pair.
void computePathwayPerturbation (MyGraph &pathway, const GEData &geData)
void plotExpressionValuesHistogram ()
 Plot the histogram of expression values for the current gene expression data set using gnuplot.
void plotExpressionCorrelationsHistogram ()
 Plot the histogram of correlations between the expression profiles of pairs of genes in the current gene expression set using gnuplot.
void processNetworkLegos (SetOfActiveNetworks &anetSet)
void readDirectories ()
void removeUnresponsiveGenes (GEData &gedata)
 Remove genes from a gene expression data set that have not responsed to the treatment/condition.
bool computeCorrelations (MyGraph &wiring)
 Compute the weights of the edges in the graph wiring based on the expression values in the current gene expression data set.
bool computeDenseSubgraphs (vector< ActiveNetwork > &denseSubgraphs, bool randomRun=false)
void setWiringDiagramEdgeWeightsFS ()
 Reweight edges in wiringDiagram to have FS-Weights.
void setWiringDiagramEdgeWeightsCD ()
 Reweight edges in wiringDiagram to have CD-distances.
void postProcess (SetOfActiveNetworks &anetSet)
void process ()
void processComputedActiveNetworks ()
void processFunctionSubgraphs ()
void processNetwork ()
void randomise (MyHistogram &histogram)
void separateDenseFunctions ()
void _openOutputFiles ()
void _closeOutputFiles ()

Public Attributes

vector< GEDatageData
map< string, set< string > > _nodeAliases
map< string, set< string > > _reversedNodeAliases
ofstream binaryMatrixStream
ofstream conditionStream
ofstream edgeStream
ofstream edgeCentralityStream
ofstream edgeEnrichmentStream
ofstream edgeEnrichedFunctionStream
ofstream edgeSimilarityGraphStream
ofstream edgeTypesCountStream
ofstream edgeWeightsHistogramStream
ofstream functionSubgraphsStream
ofstream expressionValuesHistogramStream
ofstream histogramStream
ofstream latticeStream
ofstream closedLatticeStream
ofstream logStream
ofstream nodeStream
ofstream nodeCentralityStream
ofstream nodeEnrichmentStream
ofstream nodeEnrichmentOntologizerStream
ofstream nodeEnrichedFunctionStream
ofstream processedNodeEnrichmentsStream
ofstream processedNodeEnrichmentsOntologizerStream
ofstream nodeSimilarityGraphStream
ofstream nodeWeightsHistogramStream
ofstream itemsetStream
ofstream randomStream
ofstream randomPvaluesStream
ofstream statsStream
stringstream logStringStream
map< string, string > _outputFileNames
map< string, ofstream * > outputStreams

Detailed Description

The NetMan class is a "manager" that controls the behaviour of the active-networks software by reading and storing command-line options and dispatching appropriate actions.


Member Function Documentation

void NetMan::_openOutputFiles ( void  )
bool NetMan::allowNegativeEdgeWeight ( set< string > &  types) const [inline]

Check if one of the edge types allows negative correlations.

Compute the weights of the edges in the graph wiring based on the expression values in the current gene expression data set.

Parameters:
inout]wiring, a reference to a MyGraph containing the graph whose edge weights the method computes.

For each edge in wiring, the method computes the absolute value of the correlations of the gene expression profiles of the genes incident on the edge. The correlation is zero if either of the genes is not present in the gene expression data set. The method deletes all edges with weight 0 from wiring and also deletes any resulting nodes that have degree 0.

void NetMan::computeDenseFunctions ( ostream *  fstr,
map< string, MyGraph > &  denseFunctionSubgraphs 
)

Find cross-condition and condtion-exclusive ActiveNetworks.

[in] activeNetworkFiles, a vector of files containing ActiveNetworks.

The method reads ActiveNetworks in these files, and constructs the intersection of all possible combinations of ActiveNetworks, using a version of the apriori algorithm that finds maximal itemsets in a binary matrix. The matrix created here is one whose columns are edges and whose rows are ActiveNetworks; an entry is 1 for an edge if it belongs to the ActiveNetwork.

Find functions whose nodes induce dense subgraphs.

Parameters:
[in]fstr,apointer to a file stream. If the pointer is not NULL, the method prints statistics on the subgraph induced by each function to the stream.
[out]denseFunctionSubgraphs,amap keyed by function ID. Each value is the corresponding function subgraph.

For each function, the method computes the subgraph of the wiring diagram induced by the genes annotated with that function. If the density of the subgraph is at least 4 (at arbitrary choice) and the completeness is at least 0.5, the method adds that subgraph to denseFunctionSubgraphs.

Warning:
Invoke this method only after invoking NetMan::readAnnotations() and NetMan::readNetwork()!
void NetMan::computeDenseFunctions ( ostream *  fstr = NULL) [inline]

Just like computeDenseFunctions(ofstream, map< string, MyGraph >) except that it stores the dense subgraphs internally.

The method also computes and stores the union of all the dense subgraphs.

Compute the perturbation of each pathway in each treatment-control gene expression data set pair.

(i) Read pathway file (one file with all pathways: node1, node2, pathway) and store as a set of graphs.

(ii) Read gene expression file and class file, split if necessary.

(iii) Read treatment-control file (first column contains treatment class, second column contains control class).

(iv) For every t-c pair, invoke the pathway perturbation algorithm. compute z-score of each gene. for every pathway, compute z-score of every edge and then the most activated sub-pathway.

void NetMan::computePathwayPerturbation ( const map< string, set< string > > &  treatmentControlPairs,
map< string, MyGraph > &  pathways 
)

Compute the perturbation of multiple pathways for a set of contrasts.

Given multiple pathways, indexed by name, compute the perturbation of each pathway in each of a set of contrasts. Use this method to repeat the analaysis in the paper by Rivera, Tyler, and Murali.

Parameters:
[in]treatmentControlPairsa map of sets: the keys of the map are different treatment names and the value for each key is a set of controls. The method will compute a different contrast for each treatment-control pair.
[in]pathwaysa map of instances of MyGraph, keyed by name of the pathway.
void NetMan::computePathwayPerturbation ( MyGraph pathway,
const GEData treatment,
const GEData control,
string  contrast,
ActiveNetwork subgraph 
)

Compute the perturbation of pathway in the treatment-control gene expression data set pair.

For the input treatment-control pair, compute the z-score of each gene and the z-score of every edge in pathway. Use the edge scores to compute the most perturbed sub-pathway.

Parameters:
[in]pathwayan instance of MyGraph containing the pathway.
[in]treatmentan instance of GEData containing the gene expression data for the treatment.
[in]controlan instance of GEData containing the gene expression data for the control.
[in]contrasta string naming the contrast.
[out]subgraphan instance of ActiveNetwork containing the most perturbed subgraph.

Return true if the layout of an ActiveNetwork or NetworkLego should display it embedded in the wiring diagram.

Return true if I am processing a previously computed file of active network or network lego nodes or edges.

Note:
This method is a simple substitute for checking if NetMan::getActiveNetworksEdgesFile() or NetMan::getActiveNetworksNodesFile() returns an empty string or not.

Post-process computed ActiveNetworks in multiple ways.

Parameters:
inout]anetSet, a set of ActiveNetworks.

The method computes the union of the ActiveNetworks in anetSet, the functions enriched in each ActiveNetwork, the betweenness centralities of the nodes and edges in the union, and prints all these statistics to various output files.

void NetMan::process ( void  )

The main workhorse of the ActiveNetworks system.

Process already computed ActiveNetworks.

Use this method to post-process ActiveNetworks computed by another programme. A typical use of the method is to process combined ActiveNetworks (for multiple conditions) computed by a programme such as CHARM or Apriori.

The main workhorse of last-resort ActiveNetworks system.

void NetMan::processNetwork ( void  )

If there are no gene expression datasets, compute ActiveNetworks in the wiring diagram.

Computes NetworkLegos by combining the ActiveNetworks in anetSet.

void NetMan::readNodeAliases ( string  file)

Read node aliases from file.

Parameters:
[in]file,nameof tab-delimited text file containing node aliases. Each line contains a node ID followed by the node alias. Multiple node aliases should appear on separate lines.
void NetMan::readNodeAnnotations ( string  name,
set< string > *  geneSet = NULL 
)

Read functional annotations for nodes/genes from a file and perform transitive closure, if necessary.

Parameters:
[in]name,thename of the file to read annotations from.
[in]geneSet,apointer to a set of genes. If this pointer is not NULL, the method keep annotations only for the genes in the set.
Note:
If you want the method to perform transitive closure for (GO) functional annotations, always invoke this method after Netman::readOBO().

Remove genes from a gene expression data set that have not responsed to the treatment/condition.

Parameters:
[in]geData,areference to an instance of GEData.

The method considers a gene to be unresponsive if all its expression values are between Netman::getDownRegulationBound() and Netman::getUpRegulationBound(). The method "hides" all such genes from further processing.

Split the wiring diagram into subgraphs: all the dense function subgraphs and the rest.


Member Data Documentation

map< string, set< string > > NetMan::_nodeAliases

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