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