]> git.donarmstrong.com Git - mothur.git/blob - globaldata.hpp
89089ad8686a20a5ee855a1405d4800729ee325a
[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 #include "rabundvector.hpp"
8 #include "sabundvector.hpp"
9 #include "listvector.hpp"
10
11 class ListVector;
12 class SharedListVector;
13 class SparseMatrix;
14 class FullMatrix;
15 class Tree;
16 class OrderVector;
17 class InputData;
18 class GroupMap;
19 class TreeMap;
20 class SAbundVector;
21 class RAbundVector;
22 class SequenceDB;
23
24 class GlobalData {
25 public:
26         static GlobalData* getInstance();
27         ListVector* gListVector;
28         SparseMatrix* gSparseMatrix;
29         InputData* ginput;
30         OrderVector* gorder;
31         ListVector* glist;
32         vector<Tree*> gTree;
33         SharedListVector* gSharedList;
34         SAbundVector* sabund;
35         RAbundVector* rabund;
36         GroupMap* gGroupmap;
37         FullMatrix* gMatrix;
38         TreeMap* gTreemap;
39         SequenceDB* gSequenceDB;
40         string inputFileName, helpRequest, commandName, vertical, argv;
41         bool allLines;
42         vector<string>  Estimators, Groups; //holds estimators to be used
43         set<int> lines; //hold lines to be used
44         set<string> labels; //holds labels to be used
45         vector<string> Treenames;
46         
47         string getPhylipFile();
48         string getColumnFile();
49         string getListFile();
50         string getRabundFile();
51         string getSabundFile();
52         string getNameFile();
53         string getGroupFile();
54         string getOrderFile();
55         string getFastaFile();
56         string getTreeFile();
57         string getSharedFile();
58         string getCutOff();
59         string getFormat();
60         string getPrecision();
61         string getMethod();
62         string getFileRoot();
63         string getIters();
64         string getJumble();
65         string getFreq();
66         string getAbund();
67         string getRandomTree();
68         string getGroups();
69         string getStep();
70         string getForm();
71         string getSorted();
72         string getCountEnds();
73         string getProcessors();
74         string getSize();
75         string getCandidateFile();
76         string getSearch();
77         string getKSize();
78         string getAlign();
79         string getMatch();
80         string getMismatch();
81         string getGapopen();
82         string getGapextend();
83         string getVertical();
84         string getTrump();
85         string getSoft();
86         string getHard();
87         string getScale();
88         string getStartPos();
89         string getEndPos();
90         string getMaxAmbig();
91         string getMaxHomoPolymer();
92         string getMinLength();
93         string getMaxLength();
94         string getFlip();
95         string getOligosFile();
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 setCountEnds(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, treefile, sharedfile, line, label, randomtree, groups, cutoff, format, precision, method, fileroot, iters, jumble, freq, calc, abund, step, form, sorted, trump, soft, hard, scale, countends, processors, candidatefile, search, ksize, align, match, size, mismatch, gapopen, gapextend, minLength, maxLength, startPos, endPos, maxAmbig, maxHomoPolymer, flip, oligoFile;
127
128
129         static GlobalData* _uniqueInstance;
130         GlobalData( const GlobalData& ); // Disable copy constructor
131         void operator=( const GlobalData& ); // Disable assignment operator
132         GlobalData();
133         ~GlobalData();
134         void reset();   //clears all non filename parameters
135         void readTreeString(ifstream&);
136         
137         
138         
139 };
140
141 #endif