]> git.donarmstrong.com Git - mothur.git/blob - clustercommand.h
broke up globaldata and moved error checking and help into commands
[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 GlobalData;
30
31 class ClusterCommand : public Command {
32         
33 public:
34         ClusterCommand(string); 
35         ~ClusterCommand();
36         int execute();  
37         void help();
38         
39 private:
40         GlobalData* globaldata;
41         Cluster* cluster;
42         SparseMatrix* matrix;
43         ListVector* list;
44         RAbundVector* rabund;
45         RAbundVector oldRAbund;
46         ListVector oldList;
47         OptionParser* parser;
48         map<string, string> parameters;
49         map<string, string>::iterator it;
50         bool abort;
51
52         string method, fileroot, tag;
53         double cutoff;
54         int precision, length;
55         ofstream sabundFile, rabundFile, listFile;
56         
57         void printData(string label);
58 };
59
60 #endif