]> git.donarmstrong.com Git - mothur.git/blobdiff - getoturepcommand.h
bugs for 1.5
[mothur.git] / getoturepcommand.h
index d0343daa3cb647957e694cfa101ec5406edf3304..4f755d0fccfe68dd1e03b5b36d57ce4b76287df9 100644 (file)
@@ -8,47 +8,56 @@
  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
+ /* The get.oturep command outputs a .fastarep file for each distance you specify, selecting one OTU representative for each bin. */
 
 #include "command.hpp"
 #include "globaldata.hpp"
 #include "sparsematrix.hpp"
 #include "listvector.hpp"
 #include "inputdata.h"
-#include "readmatrix.hpp"
+#include "readotu.h"
 #include "fastamap.h"
-
-
-class GlobalData;
+#include "groupmap.h"
 
 typedef list<PCell>::iterator MatData;
+typedef map<int, float> SeqMap;
 
 class GetOTURepCommand : public Command {
-       
+
 public:
-       GetOTURepCommand();     
+       GetOTURepCommand(string);
        ~GetOTURepCommand();
-       int execute();  
-       
+       int execute();
+       void help();
+
 private:
        GlobalData* globaldata;
        SparseMatrix* matrix;
        ListVector* list;
-       ListVector* listOfNames;
-       ReadMatrix* read;
+       ReadOTUFile* read;
        InputData* input;
        FastaMap* fasta;
-       string filename, fastafile, namesfile;
+       GroupMap* groupMap;
+       string filename, fastafile, listfile, namesfile, groupfile, line, label;
        ofstream out;
        ifstream in, inNames;
-       
-        
+       bool groupError;
+
+       bool abort, allLines;
+       set<int> lines; //hold lines to be used
+       set<string> labels; //holds labels to be used
        map<string, int> nameToIndex;  //maps sequence name to index in sparsematrix
-       map<int, string>::iterator it;
-       map<int, string>::iterator it2;
-       map<string, int>::iterator it3;
-       
+
+       vector<SeqMap> seqVec;                  // contains maps with sequence index and distance
+                                                                       // for all distances related to a certain sequence
+
+
        void readNamesFile();
-       string FindRep(int); // returns name of "representative" sequence of given bin.
+       int process(ListVector*);
+       string findRep(int, string&, ListVector*, int&);        // returns the name of the "representative" sequence of given bin, 
+                                                                       // fills a string containing the groups in that bin if a groupfile is given,
+                                                                       // and returns the number of sequences in the given bin
 
 };