Biorithm  1.1
Classes | Public Member Functions | Static Public Member Functions
HypergeometricAlgorithm Class Reference

This class implements the set-based hypergeometric algorithm for computing functional enrichment. More...

#include <enrichment-algorithm.h>

Inheritance diagram for HypergeometricAlgorithm:
FunctionalEnrichmentAlgorithm

List of all members.

Classes

struct  hypergeometricEnrichmentResult
 This structure stores various enrichment results calculated during functional enrichment. Any p-values that are computed will be stored in this structure along with their associated function. More...

Public Member Functions

 HypergeometricAlgorithm (const set< string > &clusterGraph, const set< string > &universeSet, MyAnnotations &annotations, const GeneOntology &go, string category)
 Constructor.
 HypergeometricAlgorithm (const MyGraph &clusterGraph, const MyGraph &universeGraph, MyAnnotations &annotations, const GeneOntology &go, string category)
 Constructor.
virtual ~HypergeometricAlgorithm ()
 Default destructor.
virtual void computeEnrichmentForFunction (const string funcType, const string funcId)
 Determines the sizes of the 4 sets needed to calculate the hyergeometric p-value: universe size, cluster size, function size, cluster-and-function size.
virtual void printEnrichmentResults (ostream &ostr)
 prints the enrichment results for each function.

Static Public Member Functions

static long double getHypergeometricPvalue (int v, int c, int v_f, int c_f)
 calculates Fisher's one-sided exact test for the given values. This sums the following over all values of k, where c_f <= k <= min(v_f, c): choose(c,k)*choose(v-c,v_f-k)/choose(v, v_f)

Detailed Description

This class implements the set-based hypergeometric algorithm for computing functional enrichment.


Constructor & Destructor Documentation

HypergeometricAlgorithm::HypergeometricAlgorithm ( const set< string > &  clusterGraph,
const set< string > &  universeSet,
MyAnnotations annotations,
const GeneOntology go,
string  category 
)

Constructor.

Parameters:
[in]clusterSetis a set of strings storing the "cluster" for which we want to compute functional enrichment.
[in]universeSeta set of strings storing the universe of genes.
[in]annotationsThe annotations for the genes.
Warning:
clusterGraph should be a subgraph of universeGraph, but the class does not check this condition.
HypergeometricAlgorithm::HypergeometricAlgorithm ( const MyGraph clusterGraph,
const MyGraph universeGraph,
MyAnnotations annotations,
const GeneOntology go,
string  category 
)

Constructor.

Parameters:
[in]clusterGraphan instance of MyGraph storing the "cluster" for which we want to compute functional enrichment.
[in]universeGraphan instance of MyGraph storing the universe of genes.
[in]annotationsThe annotations for the genes.
Warning:
clusterGraph should be a subgraph of universeGraph, but the class does not check this condition.

Member Function Documentation

void HypergeometricAlgorithm::computeEnrichmentForFunction ( const string  funcType,
const string  funcId 
) [virtual]

Determines the sizes of the 4 sets needed to calculate the hyergeometric p-value: universe size, cluster size, function size, cluster-and-function size.

Parameters:
[in]

Implements FunctionalEnrichmentAlgorithm.

long double HypergeometricAlgorithm::getHypergeometricPvalue ( int  v,
int  c,
int  v_f,
int  c_f 
) [static]

calculates Fisher's one-sided exact test for the given values. This sums the following over all values of k, where c_f <= k <= min(v_f, c): choose(c,k)*choose(v-c,v_f-k)/choose(v, v_f)

Parameters:
[in]v,thesize of the universe set V
[in]c,thesize of the "cluster" set C
[in]v_f,thesize of the set of elements in V annotated with function f.
[in]c_f,thesize of the set of elements in C annotated with function f.
void HypergeometricAlgorithm::printEnrichmentResults ( ostream &  ostr) [virtual]

prints the enrichment results for each function.

Parameters:
[in]ostr,anoutput stream to which the results will be written. Use cout for printing to a terminal.

Implements FunctionalEnrichmentAlgorithm.


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