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"; }
38 string getOutputFileNameTag(string, string);
39 string getHelpString();
40 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"; }
41 string getDescription() { return "cluster your sequences into OTUs using a distance matrix"; }
44 void help() { m->mothurOut(getHelpString()); }
48 SparseDistanceMatrix* matrix;
51 RAbundVector oldRAbund;
54 bool abort, hard, sim;
56 string method, fileroot, tag, outputDir, phylipfile, columnfile, namefile, format, distfile, countfile;
58 string showabund, timing;
59 int precision, length;
60 ofstream sabundFile, rabundFile, listFile;
66 void printData(string label);
67 vector<string> outputNames;
69 int createRabund(CountTable*&, ListVector*&, RAbundVector*&);