]> git.donarmstrong.com Git - mothur.git/blob - treegroupscommand.h
removed read.dist, read.otu, read.tree and globaldata. added current to defaults...
[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 "validcalculator.h"
17 #include "tree.h"
18 #include "treemap.h"
19 #include "readmatrix.hpp"
20 #include "readcolumn.h"
21 #include "readphylip.h"
22 #include "sparsematrix.hpp"
23
24
25 /* This command create a tree file for each similarity calculator at distance level, using various calculators to find the similiarity between groups. 
26         The user can select the lines or labels they wish to use as well as the groups they would like included.
27         They can also use as many or as few calculators as they wish. */
28         
29
30 typedef list<PCell>::iterator MatData;
31
32 class TreeGroupCommand : public Command {
33         
34 public:
35         TreeGroupCommand(string);       
36         TreeGroupCommand();
37         ~TreeGroupCommand();
38         
39         vector<string> setParameters();
40         string getCommandName()                 { return "tree.shared";                         }
41         string getCommandCategory()             { return "OTU-Based Approaches";        }
42         string getHelpString(); 
43         
44         int execute(); 
45         void help() { m->mothurOut(getHelpString()); }  
46         
47 private:
48         int createTree();
49         void printSims(ostream&);
50         int makeSimsShared();
51         int makeSimsDist();
52         
53         ReadMatrix* readMatrix;
54         SparseMatrix* matrix;
55         NameAssignment* nameMap;
56         ListVector* list;
57         TreeMap* tmap;
58         Tree* t;
59         vector<Calculator*> treeCalculators;
60         vector< vector<float> > simMatrix;
61         map<int, int> index;  //maps row in simMatrix to vector index in the tree       
62         InputData* input;
63         vector<SharedRAbundVector*> lookup;
64         string lastLabel;
65         string format, outputFile, groupNames, filename, sharedfile, inputfile;
66         int numGroups;
67         ofstream out;
68         float precision, cutoff;
69
70         bool abort, allLines;
71         set<string> labels; //holds labels to be used
72         string phylipfile, columnfile, namefile, calc, groups, label, outputDir;
73         vector<string>  Estimators, Groups, outputNames; //holds estimators to be used
74         
75         //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
76         int process(vector<SharedRAbundVector*>);
77         
78         
79
80 };
81         
82         
83 #endif
84
85