]> git.donarmstrong.com Git - mothur.git/blob - globaldata.hpp
d427aba4436eae1811be227fe0e59b25a4495be4
[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 class SequenceDB;
27
28 class GlobalData {
29 public:
30         static GlobalData* getInstance();
31         ListVector* gListVector;
32         SparseMatrix* gSparseMatrix;
33         InputData* ginput;
34         OrderVector* gorder;
35         ListVector* glist;
36         vector<Tree*> gTree;
37         SharedListVector* gSharedList;
38         SAbundVector* sabund;
39         RAbundVector* rabund;
40         GroupMap* gGroupmap;
41         FullMatrix* gMatrix;
42         TreeMap* gTreemap;
43         SequenceDB* gSequenceDB;
44         string inputFileName, helpRequest, commandName, vertical;
45         bool allLines;
46         vector<string>  Estimators, Groups; //holds estimators to be used
47         set<int> lines; //hold lines to be used
48         set<string> labels; //holds labels to be used
49         vector<string> Treenames;
50         
51         string getPhylipFile();
52         string getColumnFile();
53         string getListFile();
54         string getRabundFile();
55         string getSabundFile();
56         string getNameFile();
57         string getGroupFile();
58         string getOrderFile();
59         string getFastaFile();
60         string getNexusFile();
61         string getClustalFile();
62         string getTreeFile();
63         string getSharedFile();
64         string getCutOff();
65         string getFormat();
66         string getPrecision();
67         string getMethod();
68         string getFileRoot();
69         string getIters();
70         string getJumble();
71         string getFreq();
72         string getAbund();
73         string getRandomTree();
74         string getGroups();
75         string getStep();
76         string getForm();
77         string getSorted();
78         string getEnds();
79         string getProcessors();
80         string getSize();
81         string getTemplateFile();
82         string getSearch();
83         string getKSize();
84         string getAlign();
85         string getMatch();
86         string getMismatch();
87         string getGapopen();
88         string getGapextend();
89         string getTrump();
90         string getSoft();
91         string getFilter();
92         
93
94         string getScale();
95
96
97         void setListFile(string);
98         void setGroupFile(string file); 
99         void setPhylipFile(string);
100         void setColumnFile(string);
101         void setNameFile(string);
102         void setRabundFile(string);
103         void setSabundFile(string);
104         void setSharedFile(string);
105         void setFormat(string);
106         void setRandomTree(string);
107         void setGroups(string);
108         void setCalc(string);
109         void setEnds(string);
110         void setProcessors(string);
111
112         void clear(); 
113         void clearLabels();
114         void clearAbund();
115         
116         void parseGlobalData(string, string);
117         
118         void parseTreeFile();           //parses through tree file to find names of nodes and number of them
119                                                         //this is required in case user has sequences in the names file that are
120                                                         //not included in the tree. 
121                                                         //only takes names from the first tree in the tree file and assumes that all trees use the same names.
122
123                 
124 private:
125
126         string phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, fastafile, nexusfile, clustalfile, treefile, sharedfile, line, label, randomtree, groups;
127         string cutoff, format, precision, method, fileroot, iters, jumble, freq, calc, abund, step, form, sorted, trump, soft, filter, scale, ends, processors, templatefile, search, ksize, align, match, size;
128         string mismatch, gapopen, gapextend;
129
130
131         static GlobalData* _uniqueInstance;
132         GlobalData( const GlobalData& ); // Disable copy constructor
133         void operator=( const GlobalData& ); // Disable assignment operator
134         GlobalData();
135         ~GlobalData();
136         void reset();   //clears all non filename parameters
137         void readTreeString(ifstream&);
138         
139         
140         
141 };
142
143 #endif