1 #ifndef CLUSTERCOMMAND_H
2 #define CLUSTERCOMMAND_H
7 * Created by Sarah Westcott on 1/2/09.
8 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
12 #include "command.hpp"
13 #include "rabundvector.hpp"
14 #include "sabundvector.hpp"
15 #include "listvector.hpp"
16 #include "cluster.hpp"
17 #include "sparsedistancematrix.h"
18 #include "counttable.h"
20 /* The cluster() command:
21 The cluster command outputs a .list , .rabund and .sabund files.
22 The cluster command parameter options are method, cuttoff and precision. No parameters are required.
23 The cluster command should be in the following format: cluster(method=yourMethod, cutoff=yourCutoff, precision=yourPrecision).
24 The acceptable methods are furthest, nearest and average. If you do not provide a method the default algorythm is furthest neighbor.
25 The cluster() command outputs three files *.list, *.rabund, and *.sabund. */
28 class ClusterCommand : public Command {
31 ClusterCommand(string);
35 vector<string> setParameters();
36 string getCommandName() { return "cluster"; }
37 string getCommandCategory() { return "Clustering"; }
39 string getHelpString();
40 string getOutputPattern(string);
41 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 77:3219.\nSchloss PD, Handelsman J (2005). Introducing DOTUR, a computer program for defining operational taxonomic units and estimating species richness. Appl Environ Microbiol 71: 1501-6.\nhttp://www.mothur.org/wiki/Cluster"; }
42 string getDescription() { return "cluster your sequences into OTUs using a distance matrix"; }
45 void help() { m->mothurOut(getHelpString()); }
49 SparseDistanceMatrix* matrix;
52 RAbundVector oldRAbund;
55 bool abort, hard, sim;
57 string method, fileroot, tag, outputDir, phylipfile, columnfile, namefile, format, distfile, countfile;
59 string showabund, timing;
60 int precision, length;
61 ofstream sabundFile, rabundFile, listFile;
67 void printData(string label);
68 vector<string> outputNames;
70 int createRabund(CountTable*&, ListVector*&, RAbundVector*&);