]> git.donarmstrong.com Git - mothur.git/blob - readmatrix.hpp
started shared utilities, updates to venn and heatmap added tree.groups command
[mothur.git] / readmatrix.hpp
1 #ifndef READMATRIX_HPP
2 #define READMATRIX_HPP
3
4 /*
5  *  readmatrix.hpp
6  *  
7  *
8  *  Created by Pat Schloss on 8/13/08.
9  *  Copyright 2008 Patrick D. Schloss. All rights reserved.
10  *
11  */
12
13 #include "mothur.h"
14 #include "rabundvector.hpp"
15 #include "listvector.hpp"
16 #include "sharedlistvector.h"
17 #include "sparsematrix.hpp"
18 #include "nameassignment.hpp"
19 #include "inputdata.h"
20 #include "globaldata.hpp"
21 #include "sabundvector.hpp"
22 #include "groupmap.h"
23
24 class SparseMatrix;
25
26 class ReadMatrix {
27
28 public:
29         ReadMatrix(){   D = new SparseMatrix(); }
30         virtual void read(NameAssignment*){};
31         virtual void read(GlobalData* globaldata){};
32         void setCutoff(float c)                 {       cutoff = c;             }
33         SparseMatrix* getMatrix()               {       return D;               }
34         ListVector* getListVector()             {       return list;    }
35 //      OrderVector* getOrderVector()   {       return order;   }
36
37         int successOpen;
38         
39 protected:
40         SparseMatrix* D;
41         ListVector* list;
42         GlobalData* globaldata;
43         OrderVector* order;
44         InputData* input;
45         float cutoff;
46 };
47
48
49
50 class ReadPhylipMatrix : public ReadMatrix {
51         
52 public:
53         ReadPhylipMatrix(string);
54         ~ReadPhylipMatrix();
55         void read(NameAssignment*);
56 private:
57         ifstream fileHandle;
58         string distFile;
59 };
60
61
62
63 class ReadColumnMatrix : public ReadMatrix {
64         
65 public:
66         ReadColumnMatrix(string);
67         ~ReadColumnMatrix();
68         void read(NameAssignment*);
69 private:
70         ifstream fileHandle;
71         string distFile;
72 };
73
74
75 class ReadPhilFile : public ReadMatrix {
76         
77 public:
78         ReadPhilFile(string);
79         ~ReadPhilFile();
80         void read(GlobalData* globaldata);
81 private:
82         ifstream fileHandle;
83         string philFile;
84         InputData* input;
85         InputData* inputSabund;
86         InputData* inputList;
87         ListVector* list;
88         SharedListVector* SharedList;
89         OrderVector* order;
90         SAbundVector* sabund;
91         GlobalData* globaldata;
92         // InputData* getInput()                        {       return input;   }
93 };
94
95
96
97 #endif