]> git.donarmstrong.com Git - mothur.git/blob - clustercommand.h
added load.logfile command. changed summary.single output for subsample=t.
[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 getOutputFileNameTag(string, string);
38         string getHelpString(); 
39         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"; }
40         string getDescription()         { return "cluster your sequences into OTUs using a distance matrix"; }
41         
42         int execute(); 
43         void help() { m->mothurOut(getHelpString()); }  
44         
45 private:
46         Cluster* cluster;
47         SparseMatrix* matrix;
48         ListVector* list;
49         RAbundVector* rabund;
50         RAbundVector oldRAbund;
51         ListVector oldList;
52
53         bool abort, hard, sim;
54
55         string method, fileroot, tag, outputDir, phylipfile, columnfile, namefile, format, distfile;
56         double cutoff;
57         string showabund, timing;
58         int precision, length;
59         ofstream sabundFile, rabundFile, listFile;
60
61         bool print_start;
62         time_t start;
63         unsigned long loops;
64         
65         void printData(string label);
66         vector<string> outputNames;
67 };
68
69 #endif