]> git.donarmstrong.com Git - mothur.git/blob - treegroupscommand.h
added smart distance feature and optimized all commands using line by line processing
[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();     
38         ~TreeGroupCommand();
39         int execute();  
40         
41 private:
42         void createTree();
43         void printSims(ostream&);
44         void makeSimsShared();
45         void makeSimsDist();
46         
47         GlobalData* globaldata;
48         ReadOTUFile* read;
49         ReadMatrix* readMatrix;
50         SparseMatrix* matrix;
51         NameAssignment* nameMap;
52         ListVector* list;
53         TreeMap* tmap;
54         Tree* t;
55         vector<Calculator*> treeCalculators;
56         vector< vector<float> > simMatrix;
57         map<int, int> index;  //maps row in simMatrix to vector index in the tree       
58         InputData* input;
59         ValidCalculators* validCalculator;
60         vector<SharedRAbundVector*> lookup;
61         vector<SharedRAbundVector*> lastLookup;
62         string format, outputFile, groupNames, filename;
63         int numGroups;
64         ofstream out;
65         float precision, cutoff;
66         //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
67         void process(vector<SharedRAbundVector*>);
68
69 };
70         
71         
72 #endif
73
74