]> git.donarmstrong.com Git - mothur.git/blob - treegroupscommand.h
merged pat's trim seqs edits with sarah's major overhaul of global data; also added...
[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         int execute();  
40         void help();
41         
42 private:
43         void createTree();
44         void printSims(ostream&);
45         void makeSimsShared();
46         void makeSimsDist();
47         
48         GlobalData* globaldata;
49         ReadOTUFile* read;
50         ReadMatrix* readMatrix;
51         SparseMatrix* matrix;
52         NameAssignment* nameMap;
53         ListVector* list;
54         TreeMap* tmap;
55         Tree* t;
56         vector<Calculator*> treeCalculators;
57         vector< vector<float> > simMatrix;
58         map<int, int> index;  //maps row in simMatrix to vector index in the tree       
59         InputData* input;
60         ValidCalculators* validCalculator;
61         vector<SharedRAbundVector*> lookup;
62         vector<SharedRAbundVector*> lastLookup;
63         string format, outputFile, groupNames, filename;
64         int numGroups;
65         ofstream out;
66         float precision, cutoff;
67
68         bool abort, allLines;
69         set<int> lines; //hold lines to be used
70         set<string> labels; //holds labels to be used
71         string phylipfile, columnfile, namefile, calc, groups, line, label;
72         vector<string>  Estimators, Groups; //holds estimators to be used
73         
74         //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
75         void process(vector<SharedRAbundVector*>);
76         
77         
78
79 };
80         
81         
82 #endif
83
84