]> git.donarmstrong.com Git - mothur.git/blob - clustercommand.h
finishing the container classes, combining read.otu and read.list commands. some...
[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 "globaldata.hpp"
16 #include "command.hpp"
17 #include "rabundvector.hpp"
18 #include "sabundvector.hpp"
19 #include "listvector.hpp"
20 #include "cluster.hpp"
21 #include "sparsematrix.hpp"
22
23 /* The cluster() command:
24         The cluster command can only be executed after a successful read.phylip or read.column command.   
25         The cluster command outputs a .list , .rabund and .sabund files.  
26         The cluster command parameter options are method, cuttoff and precision. No parameters are required.  
27         The cluster command should be in the following format: cluster(method=yourMethod, cutoff=yourCutoff, precision=yourPrecision).  
28         The acceptable methods are furthest, nearest and average.  If you do not provide a method the default algorythm is furthest neighbor.  
29         The cluster() command outputs three files *.list, *.rabund, and *.sabund.   */
30
31
32 class GlobalData;
33
34 class ClusterCommand : public Command {
35         
36 public:
37         ClusterCommand();       
38         ~ClusterCommand();
39         int execute();  
40         
41 private:
42         GlobalData* globaldata;
43         Cluster* cluster;
44         SparseMatrix* matrix;
45         ListVector* list;
46         RAbundVector* rabund;
47         RAbundVector oldRAbund;
48         ListVector oldList;
49         
50         string method, fileroot, tag;
51         double cutoff;
52         int precision, length;
53         ofstream sabundFile, rabundFile, listFile;
54         
55         void printData(string label);
56 };
57
58 #endif