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