]> git.donarmstrong.com Git - mothur.git/blob - fullmatrix.h
5912b6ccc0ea323bf905bd0e9f301631276c4490
[mothur.git] / fullmatrix.h
1 #ifndef FULLMATRIX_H
2 #define FULLMATRIX_H
3 /*
4  *  fullmatrix.h
5  *  Mothur
6  *
7  *  Created by Sarah Westcott on 3/6/09.
8  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
9  *
10  */
11
12 #include "mothur.h"
13 #include "groupmap.h"
14 #include "globaldata.hpp"
15 #include "progress.hpp"
16
17 using namespace std;
18
19 struct Names {
20         string          seqName;
21         string          groupName;
22 };
23
24 class FullMatrix {
25         
26 public:
27         FullMatrix(){};
28         FullMatrix(ifstream&);
29         ~FullMatrix(){};
30         
31         int getNumSeqs();
32         vector<int> getSizes();
33         vector<string> getGroups();
34         int getNumGroups();
35         void printMatrix(ostream&);
36         float get(int, int);
37         
38 private:
39         vector< vector<float> > matrix;  //a 2D distance matrix of all the sequences and their distances to eachother.
40         void readSquareMatrix(ifstream&);  
41         void readLTMatrix(ifstream&);
42         vector<Names> index; // row in vector, sequence group.  need to know this so when we sort it can be updated.
43         vector<int> sizes;
44         vector<string> groups;
45         void sortGroups(int, int);  //this function sorts the sequences within the matrix.
46         
47         
48         GroupMap* groupmap;  //maps sequences to groups they belong to.
49         int numSeqs;
50         int numGroups;
51         int numUserGroups;
52         GlobalData* globaldata;
53 };
54
55 #endif