]> git.donarmstrong.com Git - mothur.git/blob - globaldata.hpp
adding treeclimber and unifrac pieces
[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         vector<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         vector<string> Groups;
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 getCutOff();
53         string getFormat();
54         string getPrecision();
55         string getMethod();
56         string getFileRoot();
57         string getIters();
58         string getJumble();
59         string getFreq();
60         string getRandomTree();
61         void setListFile(string);
62         void setPhylipFile(string);
63         void setColumnFile(string);
64         void setNameFile(string);
65         void setRabundFile(string);
66         void setSabundFile(string);
67         void setFormat(string);
68         void setRandomTree(string);
69
70         
71         void setListVector(ListVector*);
72         void setSparseMatrix(SparseMatrix*);
73         void clear(); 
74         
75         void parseGlobalData(string, string);
76         void splitAtEquals(string&, string&);
77         void splitAtComma(string&, string&);
78         void splitAtDash(string&, vector<string>&);
79         void splitAtDash(string&, set<int>&);
80         void splitAtDash(string&, set<string>&);
81         
82 private:
83         string phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, fastafile, treefile, line, label, randomtree, groups;
84         string cutoff, format, precision, method, fileroot, iters, jumble, freq, single, rarefaction, shared, summary, sharedsummary, sharedrarefaction;
85         static GlobalData* _uniqueInstance;
86         GlobalData( const GlobalData& ); // Disable copy constructor
87         void operator=( const GlobalData& ); // Disable assignment operator
88         GlobalData();
89         ~GlobalData();
90         ListVector* gListVector;
91         SparseMatrix* gSparseMatrix;
92         
93         
94 };
95
96 //**********************************************************************************************************************
97
98 #endif