]> git.donarmstrong.com Git - mothur.git/blob - globaldata.hpp
changed read.shared to read.list and incorporated the shared and parselist commands...
[mothur.git] / globaldata.hpp
1 #ifndef GLOBALDATA_HPP
2 #define GLOBALDATA_HPP
3
4 #include <string>
5 #include <vector>
6 #include <set>
7 #include "groupmap.h"
8
9 using namespace std;
10
11 class ListVector;
12 class SparseMatrix;
13 class OrderVector;
14 class InputData;
15 class GroupMap;
16 class SAbundVector;
17
18 class GlobalData {
19 public:
20         static GlobalData* getInstance();
21         ListVector* getListVector();
22         SparseMatrix* getSparseMatrix();
23         InputData* ginput;
24         OrderVector* gorder;
25         ListVector* glist;
26         SAbundVector* sabund;
27         GroupMap* gGroupmap;
28         string inputFileName, helpRequest, commandName;
29         bool allLines;
30         vector<string> singleEstimators, summaryEstimators, sharedEstimators, rareEstimators, sharedRareEstimators, sharedSummaryEstimators; //holds estimators to be used
31         set<int> lines; //hold lines to be used
32         set<string> labels; //holds labels to be used
33         
34         string getPhylipFile();
35         string getColumnFile();
36         string getListFile();
37         string getRabundFile();
38         string getSabundFile();
39         string getNameFile();
40         string getGroupFile();
41         string getOrderFile();
42         string getCutOff();
43         string getFormat();
44         string getPrecision();
45         string getMethod();
46         string getFileRoot();
47         string getIters();
48         string getJumble();
49         string getFreq();
50         void setListFile(string);
51         void setPhylipFile(string);
52         void setColumnFile(string);
53         void setNameFile(string);
54         void setRabundFile(string);
55         void setSabundFile(string);
56         void setFormat(string);
57
58         
59         void setListVector(ListVector*);
60         void setSparseMatrix(SparseMatrix*);
61         void clear(); 
62         
63         void parseGlobalData(string, string);
64         void splitAtEquals(string&, string&);
65         void splitAtComma(string&, string&);
66         void splitAtDash(string&, vector<string>&);
67         void splitAtDash(string&, set<int>&);
68         void splitAtDash(string&, set<string>&);
69         
70 private:
71         string phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, line, label;
72         string cutoff, format, precision, method, fileroot, iters, jumble, freq, single, rarefaction, shared, summary, sharedsummary, sharedrarefaction;
73         static GlobalData* _uniqueInstance;
74         GlobalData( const GlobalData& ); // Disable copy constructor
75         void operator=( const GlobalData& ); // Disable assignment operator
76         GlobalData();
77         ~GlobalData();
78         ListVector* gListVector;
79         SparseMatrix* gSparseMatrix;
80         void setReadFormat(string);
81         
82         };
83
84 //**********************************************************************************************************************
85
86 #endif