]> git.donarmstrong.com Git - mothur.git/blob - clustercommand.h
Thallinger changes to cluster command.
[mothur.git] / clustercommand.h
1 #ifndef CLUSTERCOMMAND_H
2 #define CLUSTERCOMMAND_H
3 /*
4  *  clustercommand.h
5  *  Dotur
6  *
7  *  Created by Sarah Westcott on 1/2/09.
8  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
9  *
10  */
11
12 #include "command.hpp"
13 #include "globaldata.hpp"
14 #include "rabundvector.hpp"
15 #include "sabundvector.hpp"
16 #include "listvector.hpp"
17 #include "cluster.hpp"
18 #include "sparsematrix.hpp"
19
20 /* The cluster() command:
21         The cluster command can only be executed after a successful read.phylip or read.column command.   
22         The cluster command outputs a .list , .rabund and .sabund files.  
23         The cluster command parameter options are method, cuttoff and precision. No parameters are required.  
24         The cluster command should be in the following format: cluster(method=yourMethod, cutoff=yourCutoff, precision=yourPrecision).  
25         The acceptable methods are furthest, nearest and average.  If you do not provide a method the default algorythm is furthest neighbor.  
26         The cluster() command outputs three files *.list, *.rabund, and *.sabund.   */
27
28
29 class ClusterCommand : public Command {
30         
31 public:
32         ClusterCommand(string); 
33         ~ClusterCommand();
34         int execute();  
35         void help();
36         
37 private:
38         GlobalData* globaldata;
39         Cluster* cluster;
40         SparseMatrix* matrix;
41         ListVector* list;
42         RAbundVector* rabund;
43         RAbundVector oldRAbund;
44         ListVector oldList;
45
46         bool abort;
47
48         string method, fileroot, tag;
49         double cutoff;
50         string showabund, timing;
51         int precision, length;
52         ofstream sabundFile, rabundFile, listFile;
53
54         bool print_start;
55         time_t start;
56         unsigned long loops;
57         
58         void printData(string label);
59 };
60
61 #endif