-
Notifications
You must be signed in to change notification settings - Fork 0
/
joiner.h
42 lines (38 loc) · 1.04 KB
/
joiner.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef _JOINER_H_
#define _JOINER_H_
#include <fstream>
using namespace std;
class Joiner {
public:
Joiner(int _numSeq, double** _score, const vector<string> & _proteinNames);
~Joiner();
// Neighbor joining algorithm's main function
void join();
// Use to decide whether to print debugging strings or not
void setVerbose(bool value);
// Save phylogenetic tree to file
void saveTree(ofstream &stream);
private:
bool verbose;
// Number of protein sequences
int numSeq;
// Number of new nodes
int numNewNodes;
// Score matrix
double **score;
// Name of proteins
vector<string> proteinNames;
// Distance matrix
double **dist;
// Sum distance matrix sumDist[i] = sum_k(dist[i][k]) for k != i
double *sumDist;
// Has the node been merged?
bool* isMerged;
// Edges of the phylogenetic tree
vector<pair<pair<string, string>, double>> edges;
// Make new node name
string makeNewName();
// Add an edge (x, y) with weight "cost" to the phylogenetic tree
void addEdge(string x, string y, double cost);
};
#endif