Biorithm  1.1
Public Member Functions
ActiveNetwork Class Reference

The ActiveNetwork class stores a single ActiveNetwork. The class is a subclass of MyGraph. The class stores the experimental conditions associated with an ActiveNetwork, the set of biological functions enriched in the nodes of the ActiveNetwork. More...

#include <active-networks.h>

Inheritance diagram for ActiveNetwork:
MyGraph NetworkLego

List of all members.

Public Member Functions

 ActiveNetwork (const MyGraph &graph)
 ActiveNetwork (const Itemset &itemset, unsigned int index)
void addCondition (string cond)
void getConditions (vector< string > &conds) const
unsigned int numConditions () const
void setPvalue (MyNT val)
MyNT getPvalue () const
void clearEdgeEnrichments ()
 Erase all computed information about edge enrichments. This method is useful when I want to try different enrichment algorithms in the same run.
void computeEdgeEnrichments (const MyAnnotations &annotations)
void computeEdgeEnrichments (map< string, Enrichment< string, string > > &annotations)
void clearNodeEnrichments ()
 Erase all computed information about node enrichments. This method is useful when I want to try different enrichment algorithms in the same run.
void computeNodeEnrichments (map< string, Enrichment< string, string > > &annotations)
 Compute the functions enriched in the nodes in the ActiveNetwork. Use ActiveNetwork::printNodeEnrichments() to print the enriched functions after invoking this method.
void computeNodeWeights (const GEData &gedata)
void printConditions (ostream &ostr) const
 Layout the ActiveNetwork but only for the genes annotated with the function nodeAnnotationToLayout.
void printEdgesItemset (ostream &itemsetStream, string id)
void printEdgeEnrichments (ostream &fstr)
void printEdgeEnrichedFunctions (ostream &ostr)
 Print the enriched functions annotating each edge.
void printNodeEnrichments (ostream &fstr, const GeneOntology *goDag=NULL)
void printItemset (ostream &ostr) const
void printNodeEnrichedFunctions (ostream &ostr)
 Print the enriched functions annotating each node.
void printStatistics (ostream &ostr)
 Print statistics on the ActiveNetwork.
void printStatisticsComponents (ostream &ostr)
 Print statistics on the connected components in the ActiveNetwork.
void expand (const GEData &expression, MyNT correlationThreshold, bool trivialExpand=true)
 Expand the invocant using edges based soley on gene expression weights.
void expand (ActiveNetwork &expanded, const GEData &expression, MyNT correlationThreshold)
void read (string anetString)
void setEnrichedFunctionsByEdge (map< string, vector< string > > &efeMap)
 Set the map from each edge to the enriched functions annotating the edge.
void setPerNodeEnrichedFunctions (map< MyNodeId, vector< string > > &efnMap)
 Set the map from each node to the enriched functions annotating the node.
void setNodeEnrichedFunctions (vector< EnrichmentRecord< string, string > > &efMap)
 Set the functions (annotating nodes) enriched in this active network from the efMap.
void updateNodeEnrichmentsMap (map< string, map< string, MyNT > > &functionsToANs, const GeneOntology *goDag=NULL)

Detailed Description

The ActiveNetwork class stores a single ActiveNetwork. The class is a subclass of MyGraph. The class stores the experimental conditions associated with an ActiveNetwork, the set of biological functions enriched in the nodes of the ActiveNetwork.


Member Function Documentation

Compute the functions enriched in the edges of the ActiveNetwork. Use ActiveNetwork::printEdgeEnrichments() to print the enriched functions after invoking this method.

Parameters:
[in]annotationsThe set of functional annotations.
Note:
If you want to compute the enrichments for a number of different ActiveNetworks, this method may be slow since it loads the annotations into Enrichment data structures. A much faster option is to use the overloaded version ActiveNetworks::computeEnrichments(map< string, Enrichment< string, string > > instead. This version takes the Enrichment data structures as input.
void ActiveNetwork::computeEdgeEnrichments ( map< string, Enrichment< string, string > > &  annotations)

Compute the functions enriched in the edges in the ActiveNetwork. Use ActiveNetwork::printEdgeEnrichments() to print the enriched functions after invoking this method.

Parameters:
[in]annotationsThe set of functional annotations. This parameter is a map from function category to an instance of Enrichment.
void ActiveNetwork::computeNodeEnrichments ( map< string, Enrichment< string, string > > &  annotations)

Compute the functions enriched in the nodes in the ActiveNetwork. Use ActiveNetwork::printNodeEnrichments() to print the enriched functions after invoking this method.

Parameters:
[in]annotations,theset of functional annotations. This parameter is a map from function category to an instance of Enrichment.
Note:
This method uses Fischer's exact test to compute enriched functions.
void ActiveNetwork::computeNodeWeights ( const GEData gedata)

Compute the weight of each node in the ActiveNetwork.

Parameters:
[in]geDataA reference to a gene expression dataset.

The weight of a node is the average expression value of the gene corresponding to the node in gedata. The method also computes the total and average weights of the nodes in the invocant.

void ActiveNetwork::expand ( const GEData expression,
MyNT  correlationThreshold,
bool  trivialExpand = true 
)

Expand the invocant using edges based soley on gene expression weights.

Add genes in expression that are highly correlated to the genes in the ActiveNetwork. The new genes are those that do not have any interactions in the underlying wiring diagram and those that may be only indirectly connected in the wiring diagram to the genes in the ActiveNetwork. For each gene not in the ActiveNetwork, the method computes the absolute value of the correlations to all the genes in the ActiveNetwork, and computes the sum of all these values. It adds the gene with the smallest sum to the ActiveNetwork, where this sum is at least the value of the density of the ActiveNetwork. Adding such a gene guarantees that the density of the ActiveNetwork does not decrease. The method continues adding genes until adding any remaining gene will decrease the density of the ActiveNetwork.

Parameters:
[in]expression,oneof the gene expression data sets that correspond to the experimental conditions that created this ActiveNetwork.
[in]trivialExpand,aboolean. If this variable is true, expand based only on gene-expression-based interactions connecting a new gene to a gene in the original ActiveNetwork. If this variable is false, connect a new gene to other newly-added genes.
Warning:
Setting trivialExpand to false can result in very large networks containing 1000s of interactions.
void ActiveNetwork::expand ( ActiveNetwork expanded,
const GEData expression,
MyNT  correlationThreshold 
) [inline]

The method performs the same action as ActiveNetwork::expand, except that it returns the expanded network in expanded.

Parameters:
[out]expanded,aninstance of ActiveNetwork.
[in]expression,aninstance of GEData.
void ActiveNetwork::printConditions ( ostream &  ostr) const

Layout the ActiveNetwork but only for the genes annotated with the function nodeAnnotationToLayout.

The method will layout only the subgraph of the invocant that is induced by genes annotated with the function nodeAnnotationToLayout. If superGraph is not NULL, then the method will include genes in the superGraph that are annotated with this function but are not nodes in the invocant; the method will mark these nodes differently.

The parameters nodeAnnotationToLayout, nodeAliases, nodeUrl, superGraph serve the same role as in ActiveNetwork::layout().

Parameters:
[in]annotations,aninstance of MyAnnotations containing functions annotating all the genes.
[in]nodeAnnotationToLayout,theid of the function for which to layout the ActiveNetwork.
[in]otherActiveNetworks,apointer to a set of pointer to ActiveNetwork. If this pointer is not NULL, the method will extract from each ActiveNetwork, the subgraph induced by the genes annotated with nodeAnnotationToLayout. The method will also colour each gene (node) in the layout based on which ActiveNetworks (including the invocant) the gene is a member of.
[in]geDataSets,apointer to a SetOfPointSets. If this pointer is not NULL, the method will add colours to each node corresponding to the expression values of that node in the gene expression data. If otherActiveNetworks is not NULL, each node will also contain colours for each network in otherActiveNetworks that the node is present in. In both cases, geDataSets must contain individual one gene expression dataset for each ActiveNetwork (either the invocant or in otherActiveNetworks).
[in]efDict,apointer to a google::TemplateDictionary, which the method will fill in with names of variables in single-enriched-function.pl.
Note:
Passing a non-NULL superGraph to different invocations of this method (with different invocants) is a convenient way of ensuring that the same graph is laid out in all the invocations.
Warning:
This method will have undefined behaviour if you pass a non-NULL value otherActiveNetworks but a null value of superGraph. It prints an error to stderr in this case. Print the conditions in the ActiveNetwork.

Print the enriched functions annotating each edge.

Parameters:
[out]ostr,anoutput stream to print to.

For each edge in the invocant, this method prints all the functions enriched in the invocant that annotate the edge. The method prints each edge-function pair on a separate line.

void ActiveNetwork::printEdgeEnrichments ( ostream &  fstr)

Print the functions enriched in the edges in the ActiveNetwork.

Parameters:
[out]ostreamA stream to print the enrichment information to.
Warning:
Invoke this method only after ActiveNetwork::computeEdgeEnrichments().
void ActiveNetwork::printEdgesItemset ( ostream &  itemsetStream,
string  id 
)

Print the edges and conditions in the ActiveNetwork in "itemset" format.

void ActiveNetwork::printItemset ( ostream &  ostr) const

Print the interactions and conditions in the module in "itemset" format.

Print the enriched functions annotating each node.

Parameters:
[out]ostr,anoutput stream to print to.

For each node in the invocant, this method prints all the functions enriched in the invocant that annotate the node. The method prints each node-function pair on a separate line.

void ActiveNetwork::printNodeEnrichments ( ostream &  fstr,
const GeneOntology goDag = NULL 
)

Print the functions enriched in the nodes in the ActiveNetwork.

Parameters:
[in]annotations,theset of functional annotations.
[out]ostream,astream to print the enrichment information to.
[in]goDag,apointer to an instance of GeneOntology, storing the structure of the Gene Ontology.
Warning:
Invoke this method only after ActiveNetwork::computeNodeEnrichments().
void ActiveNetwork::printStatistics ( ostream &  ostr)

Print statistics on the ActiveNetwork.

Parameters:
[out]ostr,anoutput stream to print to.

The method prints the following statistics on the ActiveNetwork:

  • the name,
  • the number of nodes,
  • the number of edges,
  • the weighted density (taking edge weights into consideration),
  • the total edge weight,
  • the average weight per edge,
  • the unweighted density (assuming each edge has weight one) and
  • the p-value of the ActiveNetwork.
void ActiveNetwork::printStatisticsComponents ( ostream &  ostr)

Print statistics on the connected components in the ActiveNetwork.

Parameters:
[out]ostr,anoutput stream to print to.

The method prints the following statistics on the ActiveNetwork:

  • the name,
  • the number of nodes,
  • the number of edges,
  • the number of connected components,
  • a list of pairs of the number of nodes and the number of edges in each connected component.
void ActiveNetwork::read ( string  anetString)

Read the ActiveNetwork from a description in a string.

Parameters:
[in]anetString,thestring describing the ActiveNetwork.

Reads an ActiveNetwork from a string. The string contains multiple substrings separated by tabs. The substrings are in order:

(i) A string containing the name of the ActiveNetwork, the number of edges in the ActiveNetwork, and the number of conditions in the ActiveNetwork, all separated by underscores,

(ii) the edges of the ActiveNetwork; each edge is a string made up of the first node, the edge type, and the second node, all separated by underscores, and

(iii) the conditions in the ActiveNetwork.

void ActiveNetwork::setPvalue ( MyNT  val) [inline]

Set the pvalue of the ActiveNetwork.

void ActiveNetwork::updateNodeEnrichmentsMap ( map< string, map< string, MyNT > > &  functionsToANs,
const GeneOntology goDag = NULL 
)

Add enriched functions annotating nodes and the p-values to the input map.

Parameters:
[in]functionsToANs,atwo dimensional map first keyed by function id and then by active network id , and storing the p-value of an enriched function in an active network.

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