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