]> git.donarmstrong.com Git - mothur.git/blob - globaldata.hpp
*** empty log message ***
[mothur.git] / globaldata.hpp
1 #ifndef GLOBALDATA_HPP
2 #define GLOBALDATA_HPP
3
4 #include "mothur.h"
5 #include "groupmap.h"
6 #include "treemap.h"
7
8 #include "rabundvector.hpp"
9 #include "sabundvector.hpp"
10 #include "listvector.hpp"
11
12
13 using namespace std;
14
15 class ListVector;
16 class SharedListVector;
17 class SparseMatrix;
18 class FullMatrix;
19 class Tree;
20 class OrderVector;
21 class InputData;
22 class GroupMap;
23 class TreeMap;
24 class SAbundVector;
25 class RAbundVector;
26
27 class GlobalData {
28 public:
29         static GlobalData* getInstance();
30         ListVector* gListVector;
31         SparseMatrix* gSparseMatrix;
32         InputData* ginput;
33         OrderVector* gorder;
34         ListVector* glist;
35         vector<Tree*> gTree;
36         SharedListVector* gSharedList;
37         SAbundVector* sabund;
38         RAbundVector* rabund;
39         GroupMap* gGroupmap;
40         FullMatrix* gMatrix;
41         TreeMap* gTreemap;
42         string inputFileName, helpRequest, commandName, vertical;
43         bool allLines;
44         vector<string>  Estimators, Groups; //holds estimators to be used
45         set<int> lines; //hold lines to be used
46         set<string> labels; //holds labels to be used
47         vector<string> Treenames;
48         
49         string getPhylipFile();
50         string getColumnFile();
51         string getListFile();
52         string getRabundFile();
53         string getSabundFile();
54         string getNameFile();
55         string getGroupFile();
56         string getOrderFile();
57         string getFastaFile();
58         string getNexusFile();
59         string getClustalFile();
60         string getTreeFile();
61         string getSharedFile();
62         string getCutOff();
63         string getFormat();
64         string getPrecision();
65         string getMethod();
66         string getFileRoot();
67         string getIters();
68         string getJumble();
69         string getFreq();
70         string getAbund();
71         string getRandomTree();
72         string getGroups();
73         string getStep();
74         string getForm();
75         string getSorted();
76
77         string getTrump();
78         string getSoft();
79         string getFilter();
80         
81
82         string getScale();
83
84
85         void setListFile(string);
86         void setPhylipFile(string);
87         void setColumnFile(string);
88         void setNameFile(string);
89         void setRabundFile(string);
90         void setSabundFile(string);
91         void setFormat(string);
92         void setRandomTree(string);
93         void setGroups(string);
94         void setCalc(string);
95
96         void clear(); 
97         void clearLabels();
98         void clearAbund();
99         
100         void parseGlobalData(string, string);
101         
102         void parseTreeFile();           //parses through tree file to find names of nodes and number of them
103                                                         //this is required in case user has sequences in the names file that are
104                                                         //not included in the tree. 
105                                                         //only takes names from the first tree in the tree file and assumes that all trees use the same names.
106
107                 
108 private:
109
110         string phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, fastafile, nexusfile, clustalfile, treefile, sharedfile, line, label, randomtree, groups;
111         string cutoff, format, precision, method, fileroot, iters, jumble, freq, calc, abund, step, form, sorted, trump, soft, filter, scale;
112
113
114         static GlobalData* _uniqueInstance;
115         GlobalData( const GlobalData& ); // Disable copy constructor
116         void operator=( const GlobalData& ); // Disable assignment operator
117         GlobalData();
118         ~GlobalData();
119         void reset();   //clears all non filename parameters
120         void readTreeString(ifstream&);
121         
122         
123         
124 };
125
126 #endif