]> git.donarmstrong.com Git - mothur.git/blob - clustercommand.h
working on citations
[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         
40         int execute(); 
41         void help() { m->mothurOut(getHelpString()); }  
42         
43 private:
44         Cluster* cluster;
45         SparseMatrix* matrix;
46         ListVector* list;
47         RAbundVector* rabund;
48         RAbundVector oldRAbund;
49         ListVector oldList;
50
51         bool abort, hard, sim;
52
53         string method, fileroot, tag, outputDir, phylipfile, columnfile, namefile, format, distfile;
54         double cutoff;
55         string showabund, timing;
56         int precision, length;
57         ofstream sabundFile, rabundFile, listFile;
58
59         bool print_start;
60         time_t start;
61         unsigned long loops;
62         
63         void printData(string label);
64         vector<string> outputNames;
65 };
66
67 #endif