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