]> git.donarmstrong.com Git - mothur.git/blobdiff - clustercommand.h
working on pam
[mothur.git] / clustercommand.h
index 787f835a0f33d1d157aeab41568286c28a752520..cd9f47b07d9e8af9a6f04c014fabcfaf36a2818e 100644 (file)
  */
 
 #include "command.hpp"
-#include "globaldata.hpp"
 #include "rabundvector.hpp"
 #include "sabundvector.hpp"
 #include "listvector.hpp"
 #include "cluster.hpp"
-#include "sparsematrix.hpp"
+#include "sparsedistancematrix.h"
+#include "counttable.h"
 
 /* The cluster() command:
-       The cluster command can only be executed after a successful read.phylip or read.column command.   
        The cluster command outputs a .list , .rabund and .sabund files.  
        The cluster command parameter options are method, cuttoff and precision. No parameters are required.  
        The cluster command should be in the following format: cluster(method=yourMethod, cutoff=yourCutoff, precision=yourPrecision).  
-       The acceptable methods are furthest, nearest and average.  If you do not provide a method the default algorythm is furthest neighbor.  
+       The acceptable methods are furthest, nearest and average.  If you do not provide a method the default algorithm is furthest neighbor.  
        The cluster() command outputs three files *.list, *.rabund, and *.sabund.   */
 
 
@@ -32,26 +31,32 @@ public:
        ClusterCommand(string);
        ClusterCommand();
        ~ClusterCommand();
-       vector<string> getRequiredParameters();
-       vector<string> getValidParameters();
-       vector<string> getRequiredFiles();
-       map<string, vector<string> > getOutputFiles() { return outputTypes; }
-       int execute();  
-       void help();
+       
+       vector<string> setParameters();
+       string getCommandName()                 { return "cluster";             }
+       string getCommandCategory()             { return "Clustering";  }
+       
+       string getHelpString(); 
+    string getOutputPattern(string);   
+       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"; }
+       string getDescription()         { return "cluster your sequences into OTUs using a distance matrix"; }
+       
+       int execute(); 
+       void help() { m->mothurOut(getHelpString()); }  
        
 private:
-       GlobalData* globaldata;
        Cluster* cluster;
-       SparseMatrix* matrix;
+       SparseDistanceMatrix* matrix;
        ListVector* list;
        RAbundVector* rabund;
        RAbundVector oldRAbund;
        ListVector oldList;
 
-       bool abort, hard;
+       bool abort, hard, sim;
 
-       string method, fileroot, tag, outputDir;
+       string method, fileroot, tag, outputDir, phylipfile, columnfile, namefile, format, distfile, countfile;
        double cutoff;
+    float adjust;
        string showabund, timing;
        int precision, length;
        ofstream sabundFile, rabundFile, listFile;
@@ -62,7 +67,8 @@ private:
        
        void printData(string label);
        vector<string> outputNames;
-       map<string, vector<string> > outputTypes;
+    
+    int createRabund(CountTable*&, ListVector*&, RAbundVector*&);
 };
 
 #endif