Biorithm  1.1
Public Member Functions | Protected Attributes
MyAbstractGainAlgo< StateType > Class Template Reference
Inheritance diagram for MyAbstractGainAlgo< StateType >:
MyReallyAbstractGainAlgo

List of all members.

Public Member Functions

 MyAbstractGainAlgo (MyGainGraph &g, MyAnnotations &a, MyGainParams &p, Reporter &r, GeneOntology *go=NULL)
virtual void computeCrossValidationResults (const BioFunction &function, const MyNodeIdList &cvNodes)=0
 Compute results of cross validation.
virtual void computeCut (MyNodeIdList &nodesToAnnotate, MyNodeIdSet &cutNodes)
 After assinging states to all nodes, compute the induced cut.
virtual void computePredictions (const BioFunction &function, const MyNodeIdList &nodesToAnnotate, MyNodeIdList &predictedNodes)=0
 Compute the confidence in each prediction.
virtual MyGainState< StateType > computeState (MyNode &node)=0
virtual void constructCrossValidationLists (vector< MyNodeIdList > &cvLists)=0
 Construct lists of nodes for cross validation.
virtual bool hasConverged (const MyNodeIdList &nodesToAnnotate)=0
virtual void crossValidate (const BioFunction &function)
virtual void maskNodeStates (const MyNodeIdList &nodes)=0
 "Forget" known annotations/states of nodes prior to cross validation.
virtual void evaluatePredictions (MyAnnotations &newAnnotations)
 "Remember" known annotations/states of nodes after cross validation.
virtual string getName ()=0
virtual void initialiseNodeStates (const BioFunction &function, MyNodeIdList &nodesToAnnotate)=0
virtual void pipeline (const BioFunction &function)
 The complete pipeline of computation for functional annotation.
virtual void predict (const BioFunction &function)
virtual void run (const MyNodeIdList &nodesToAnnotate)=0
virtual void setCrossValidationList (MyNodeIdList &nodesToAnnotate, const MyNodeIdList &cvList)
virtual void visualiseCrossValidation (const BioFunction &currentFunction)
virtual void visualiseCut (const BioFunction &currentFunction, MyNodeIdList &predictedNodes)
 Layout a graph that highlights the cut seprating nodes annotated with or predicted to be annotated with currentFunction from all the other nodes.
virtual void visualisePredictions (const BioFunction &currentFunction, MyNodeIdList &nodesToAnnotate)
virtual void initialiseEdgeWeights (const BioFunction &function)
virtual void initialiseEdgeWeightsCutoff (const BioFunction &function)
virtual void initialiseEdgeWeightsDepth (const BioFunction &function)
virtual void removeUnpredictableNodes (const MyNodeIdSet &unpredictableNodes, MyNodeIdList &oldNodes)

Protected Attributes

MyAnnotations_annotations
BioFunction _currentFunction
GeneOntology_go
MyGainGraph_graph
MyGainParams_params
Reporter_reporter
map< StateType, MyNodeIdList > _nodesByInitialStateType
map< StateType, MyNodeIdList > _nodesByRealStateType
map< MyNodeId, MyGainStateInfo
< MyGainState< StateType > > > 
_states
map< MyNodeId, StateType > _realStateTypes
map< MyNodeId, StateType > _initialStateTypes
MyNodeIdSet _cutNodes

template<typename StateType>
class MyAbstractGainAlgo< StateType >


Member Function Documentation

template<typename StateType>
virtual void MyAbstractGainAlgo< StateType >::computeCrossValidationResults ( const BioFunction function,
const MyNodeIdList &  cvNodes 
) [pure virtual]

Compute results of cross validation.

After invoking crossValidate(), compute the results. Each algorithm needs to define this method, since the algorithm stores the node states.

Implemented in MyOneVersusAllGeneManiaGainAlgo, MyOneVersusAllSinkSourceGainAlgo, and MyOneVersusAllGainAlgo.

template<typename StateType>
virtual void MyAbstractGainAlgo< StateType >::computeCut ( MyNodeIdList &  nodesToAnnotate,
MyNodeIdSet &  cutNodes 
) [inline, virtual]

After assinging states to all nodes, compute the induced cut.

An edge is inconsistent if it is incident on nodes with different states. We define the cut as the set of inconsistent edges. Removing these edges decomposes the graph into connected components such that in component, all nodes are in the same state. The method computes the nodes predicted to be annotated with the current function that are incident on edges in the cut.

Parameters:
[in]nodesToAnnotate,thelist of nodes to be annotated.
[out]cutNodes,thelist of nodes in the cut.
Note:
By definition, only edges incident on nodes in nodesToAnnotate are eligible to belong to the cut since the evidence propagation algorithms do not propagate any information across other edges.

Reimplemented in MyOneVersusAllGainAlgo.

template<typename StateType>
virtual void MyAbstractGainAlgo< StateType >::computePredictions ( const BioFunction function,
const MyNodeIdList &  nodesToAnnotate,
MyNodeIdList &  predictedNodes 
) [pure virtual]

Compute the confidence in each prediction.

For each prediction, compute the algorithm's confidence in the prediction as the distance of the node from the cut.

Implemented in MyOneVersusAllGeneManiaGainAlgo, MyOneVersusNoneFunctionalFlowGainAlgo, MyOneVersusAllSinkSourceGainAlgo, MyOneVersusAllSemiHierarchicalHopfieldGainAlgo, and MyOneVersusAllGainAlgo.

template<typename StateType>
virtual MyGainState< StateType > MyAbstractGainAlgo< StateType >::computeState ( MyNode node) [pure virtual]

This method should be a member of this class since the method needs access to the states of the nodes (stored in subclasses of the class).

Implemented in MyOneVersusAllGeneManiaGainAlgo, MyOneVersusNoneLocalGainAlgo, MyOneVersusNoneFunctionalFlowGainAlgo, MyOneVersusAllSinkSourceGainAlgo, MyOneVersusAllHopfieldGainAlgo, MyOneVersusAllLocalGainAlgo, and MyOneVersusAllGainAlgo.

template<typename StateType>
virtual void MyAbstractGainAlgo< StateType >::constructCrossValidationLists ( vector< MyNodeIdList > &  cvLists) [pure virtual]

Construct lists of nodes for cross validation.

Parameters:
[out]cvLists,avector of MyNodeIdLists.

Each element of this vector contains a list of node ids (stored in a MyNodeIdList) whose annotation details should be deleted for cross validation. In the case of leave-one-out cross validation, each element of the vector will contain just one node.

Implemented in MyOneVersusAllGainAlgo.

template<typename StateType >
void MyAbstractGainAlgo< StateType >::evaluatePredictions ( MyAnnotations newAnnotations) [virtual]

"Remember" known annotations/states of nodes after cross validation.

Parameters:
[in]nodes,aMyNodeIdList containing a list of node IDs for which I should unmask state and annotation information.Evaluate the predictions made by the algorithm based on the (new) annotations.

The method compares the current annotations (on which the algorithm based the predictions) with newAnnotations. It first finds those genes for which the algorithm made predictions and that have new annotations in newAnnotations. For each such gene, the method computes the distance of each prediction to the closest new annotation for that gene. The method outputs results to a file.

Note:
Invoke this method only after making predictions for all functions.
template<typename StateType>
virtual string MyAbstractGainAlgo< StateType >::getName ( ) [pure virtual]
template<typename StateType>
virtual void MyAbstractGainAlgo< StateType >::maskNodeStates ( const MyNodeIdList &  nodes) [pure virtual]

"Forget" known annotations/states of nodes prior to cross validation.

Parameters:
[in]nodes,aMyNodeIdList containing a list of node IDs for which I should mask state and annotation information.

Implemented in MyOneVersusAllGeneManiaGainAlgo, MyOneVersusAllSinkSourceGainAlgo, and MyOneVersusAllGainAlgo.

template<typename StateType >
void MyAbstractGainAlgo< StateType >::setCrossValidationList ( MyNodeIdList &  nodesToAnnotate,
const MyNodeIdList &  cvList 
) [virtual]

Given a list of unannotated nodes (nodesToAnnotate) and a list of nodes to cross validate (cvList),update nodesToAnnotate to include nodes in cvList, so that the annotation algorithm also annotates the nodes in cvList.

Warning:
Call this method only after invoking maskNodeStates().
Note:
This method is virtual since some algorithms can set nodesToAnnotate to be equal to cvList, for example, algorithms that use only one round of "guilt-by-association," where each node computes its state from the states of its neighbours.

Reimplemented in MyOneVersusAllGeneManiaGainAlgo, MyOneVersusNoneSinkSourceGainAlgo, MyOneVersusAllAbstractSVMGainAlgo, and MyOneVersusNoneGainAlgo.

template<typename StateType >
void MyAbstractGainAlgo< StateType >::visualiseCrossValidation ( const BioFunction currentFunction) [virtual]

Layout the functional linkage network to visualise the results.

template<typename StateType >
void MyAbstractGainAlgo< StateType >::visualiseCut ( const BioFunction currentFunction,
MyNodeIdList &  predictedNodes 
) [virtual]

Layout a graph that highlights the cut seprating nodes annotated with or predicted to be annotated with currentFunction from all the other nodes.

The method lays out the graph induced by the edges in the cut and all the nodes on the "currentFunction" side of the cut.

Reimplemented in MyOneVersusAllAbstractSVMGainAlgo, and MyOneVersusAllGainAlgo.


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