1 #ifndef __UPGMAALGORITHM_H
2 #define __UPGMAALGORITHM_H
6 #include "../../general/clustalw.h"
7 #include "../AlignmentSteps.h"
8 #include "RootedGuideTree.h"
23 auto_ptr<AlignmentSteps> generateTree(RootedGuideTree* phyTree,
24 DistMatrix* distMat, SeqInfo* seqInfo,
25 bool overwrite, ofstream* tree = 0);
26 void setVerbose(bool _verbose){verbose = _verbose;}
29 Node **initialiseNodes(double *distanceMatrix, int firstSeq);
31 Node *doUPGMA(Node **nodes, ofstream* tree);
32 void printAllNodes(Node** nodes);
33 void addAlignmentStep(vector<int>* group1, vector<int>* group2);
34 Node** getNodeWithMinDist(Node** clusters);
35 void recomputeNodeToJoin1DistMatRow(Node* nodeToJoin1, double** nodeToJoin2DistIter);
36 void computeAllOtherDistsToNewNode(Node* nodeToJoin1, Node* nodeToJoin2,
37 double** nodeToJoin2DistIter);
38 void computeDistsUpToNodeToJoin2(Node* nToJoin1, Node* nToJoin2,
39 double** nodeToJoin2DistIter);
40 void computeDistsForNodesAfterNode2(Node* nToJoin2);
41 void movePtrPastUnusedDistances(double** ptrToDist)
43 while(**ptrToDist < 0)
48 double calcNewDist(double dist1, double dist2);
49 //vector<Node*>::iterator getIterToNodeWithMinDist(vector<Node*>* nodesLeft);
51 auto_ptr<AlignmentSteps> progSteps;
54 int orderNode1, orderNode2, orderNewNode;