]> git.donarmstrong.com Git - mothur.git/blob - clustercommand.h
Initial revision
[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 <Carbon/Carbon.h>
13 #include <iostream>
14 #include <fstream>
15 #include "command.hpp"
16 #include "rabundvector.hpp"
17 #include "listvector.hpp"
18 #include "cluster.hpp"
19 #include "sparsematrix.hpp"
20
21 /* The cluster() command:
22         The cluster command can only be executed after a successful read.phylip or read.column command.   
23         The cluster command outputs a .list , .rabund and .sabund files.  
24         The cluster command parameter options are method, cuttoff and precision. No parameters are required.  
25         The cluster command should be in the following format: cluster(method=yourMethod, cutoff=yourCutoff, precision=yourPrecision).  
26         The acceptable methods are furthest, nearest and average.  If you do not provide a method the default algorythm is furthest neighbor.  
27         The cluster() command outputs three files *.list, *.rabund, and *.sabund.   */
28
29
30 class GlobalData;
31
32 class ClusterCommand : public Command {
33         
34 public:
35         ClusterCommand();       
36         ~ClusterCommand();
37         int execute();  
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         
48         string method, fileroot, tag;
49         double cutoff;
50         int precision, length;
51         ofstream sabundFile, rabundFile, listFile;
52         
53         void printData(string label);
54 };
55
56 #endif