]> git.donarmstrong.com Git - mothur.git/blob - clustercommand.h
Revert to previous commit
[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 "rabundvector.hpp"
14 #include "sabundvector.hpp"
15 #include "listvector.hpp"
16 #include "cluster.hpp"
17 #include "sparsematrix.hpp"
18
19 /* The cluster() command:
20         The cluster command outputs a .list , .rabund and .sabund files.  
21         The cluster command parameter options are method, cuttoff and precision. No parameters are required.  
22         The cluster command should be in the following format: cluster(method=yourMethod, cutoff=yourCutoff, precision=yourPrecision).  
23         The acceptable methods are furthest, nearest and average.  If you do not provide a method the default algorythm is furthest neighbor.  
24         The cluster() command outputs three files *.list, *.rabund, and *.sabund.   */
25
26
27 class ClusterCommand : public Command {
28         
29 public:
30         ClusterCommand(string);
31         ClusterCommand();
32         ~ClusterCommand();
33         
34         vector<string> setParameters();
35         string getCommandName()                 { return "cluster";             }
36         string getCommandCategory()             { return "Clustering";  }
37         string getHelpString(); 
38         string getCitation() { return "Schloss PD, Westcott SL (2011). Assessing and improving methods used in OTU-based approaches for 16S rRNA gene sequence analysis. Appl Environ Microbiol. \nhttp://www.mothur.org/wiki/Cluster"; }
39         string getDescription()         { return "cluster your sequences into OTUs using a distance matrix"; }
40         
41         int execute(); 
42         void help() { m->mothurOut(getHelpString()); }  
43         
44 private:
45         Cluster* cluster;
46         SparseMatrix* matrix;
47         ListVector* list;
48         RAbundVector* rabund;
49         RAbundVector oldRAbund;
50         ListVector oldList;
51
52         bool abort, hard, sim;
53
54         string method, fileroot, tag, outputDir, phylipfile, columnfile, namefile, format, distfile;
55         double cutoff;
56         string showabund, timing;
57         int precision, length;
58         ofstream sabundFile, rabundFile, listFile;
59
60         bool print_start;
61         time_t start;
62         unsigned long loops;
63         
64         void printData(string label);
65         vector<string> outputNames;
66 };
67
68 #endif