]> git.donarmstrong.com Git - mothur.git/blob - treegroupscommand.h
added pipeline commands which involved change to command factory and command class...
[mothur.git] / treegroupscommand.h
1 #ifndef TREEGROUPCOMMAND_H
2 #define TREEGROUPCOMMAND_H
3
4 /*
5  *  treegroupscommand.h
6  *  Mothur
7  *
8  *  Created by Sarah Westcott on 4/8/09.
9  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10  *
11  */
12  
13 #include "command.hpp"
14 #include "inputdata.h"
15 #include "groupmap.h"
16 #include "readotu.h"
17 #include "validcalculator.h"
18 #include "tree.h"
19 #include "treemap.h"
20 #include "readmatrix.hpp"
21 #include "readcolumn.h"
22 #include "readphylip.h"
23 #include "sparsematrix.hpp"
24
25
26 /* This command create a tree file for each similarity calculator at distance level, using various calculators to find the similiarity between groups. 
27         The user can select the lines or labels they wish to use as well as the groups they would like included.
28         They can also use as many or as few calculators as they wish. */
29         
30 class GlobalData;
31
32 typedef list<PCell>::iterator MatData;
33
34 class TreeGroupCommand : public Command {
35         
36 public:
37         TreeGroupCommand(string);       
38         TreeGroupCommand();
39         ~TreeGroupCommand();
40         vector<string> getRequiredParameters();
41         vector<string> getValidParameters();
42         vector<string> getRequiredFiles();
43         map<string, vector<string> > getOutputFiles() { return outputTypes; }
44         int execute();  
45         void help();
46         
47 private:
48         int createTree();
49         void printSims(ostream&);
50         int makeSimsShared();
51         int makeSimsDist();
52         
53         GlobalData* globaldata;
54         ReadOTUFile* read;
55         ReadMatrix* readMatrix;
56         SparseMatrix* matrix;
57         NameAssignment* nameMap;
58         ListVector* list;
59         TreeMap* tmap;
60         Tree* t;
61         vector<Calculator*> treeCalculators;
62         vector< vector<float> > simMatrix;
63         map<int, int> index;  //maps row in simMatrix to vector index in the tree       
64         InputData* input;
65         ValidCalculators* validCalculator;
66         vector<SharedRAbundVector*> lookup;
67         string lastLabel;
68         string format, outputFile, groupNames, filename;
69         int numGroups;
70         ofstream out;
71         float precision, cutoff;
72         map<string, vector<string> > outputTypes;
73
74         bool abort, allLines;
75         set<string> labels; //holds labels to be used
76         string phylipfile, columnfile, namefile, calc, groups, label, outputDir;
77         vector<string>  Estimators, Groups, outputNames; //holds estimators to be used
78         
79         //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
80         int process(vector<SharedRAbundVector*>);
81         
82         
83
84 };
85         
86         
87 #endif
88
89