X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=getoturepcommand.h;h=daf5bc16cbd3640093502d315af1f35008300ef0;hp=7a17c9de22a4c08b8d44a6e59ea3c6f07f18430a;hb=cf9987b67aa49777a4c91c2d21f96e58bf17aa82;hpb=1916dd65829d6bb5b8bef74eddc61ea38fccf63a diff --git a/getoturepcommand.h b/getoturepcommand.h index 7a17c9d..daf5bc1 100644 --- a/getoturepcommand.h +++ b/getoturepcommand.h @@ -12,26 +12,25 @@ /* 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 "listvector.hpp" #include "inputdata.h" -#include "readotu.h" #include "fastamap.h" #include "groupmap.h" #include "readmatrix.hpp" #include "formatmatrix.h" +#include "counttable.h" -typedef list::iterator MatData; typedef map SeqMap; struct repStruct { string name; - int bin; + string bin; + int simpleBin; int size; string group; repStruct(){} - repStruct(string n, int b, int s, string g) : name(n), bin(b), size(s), group(g) {} + repStruct(string n, string b, int sb, int s, string g) : name(n), bin(b), size(s), group(g), simpleBin(sb) { } ~repStruct() {} }; @@ -40,28 +39,33 @@ class GetOTURepCommand : public Command { public: GetOTURepCommand(string); GetOTURepCommand(); - ~GetOTURepCommand(); - vector getRequiredParameters(); - vector getValidParameters(); - vector getRequiredFiles(); - map > getOutputFiles() { return outputTypes; } - int execute(); - void help(); + ~GetOTURepCommand(){} + + vector setParameters(); + string getCommandName() { return "get.oturep"; } + string getCommandCategory() { return "OTU-Based Approaches"; } + + string getHelpString(); + string getOutputPattern(string); + string getCitation() { return "http://www.mothur.org/wiki/Get.oturep"; } + string getDescription() { return "gets a representative sequence for each OTU"; } + + int execute(); + void help() { m->mothurOut(getHelpString()); } + + private: - GlobalData* globaldata; ListVector* list; - ReadOTUFile* read; - InputData* input; - FastaMap* fasta; GroupMap* groupMap; ReadMatrix* readMatrix; FormatMatrix* formatMatrix; NameAssignment* nameMap; - string filename, fastafile, listfile, namefile, groupfile, label, sorted, phylipfile, columnfile, distFile, format, outputDir, groups; + CountTable ct; + string filename, fastafile, listfile, namefile, groupfile, label, sorted, phylipfile, countfile, columnfile, distFile, format, outputDir, groups, method; ofstream out; ifstream in, inNames, inRow; - bool abort, allLines, groupError, large, weighted; + bool abort, allLines, groupError, large, weighted, hasGroups; set labels; //holds labels to be used map nameToIndex; //maps sequence name to index in sparsematrix map nameFileMap; @@ -72,16 +76,16 @@ private: vector seqVec; // contains maps with sequence index and distance // for all distances related to a certain sequence vector rowPositions; - map > outputTypes; - void readNamesFile(); + void readNamesFile(FastaMap*&); void readNamesFile(bool); int process(ListVector*); SeqMap getMap(int); - string findRep(vector); // returns the name of the "representative" sequence of given bin or subset of a bin, for groups + string findRep(vector, string); // returns the name of the "representative" sequence of given bin or subset of a bin, for groups + string findRepAbund(vector, string); int processNames(string, string); - - + int processFastaNames(string, string, FastaMap*&); + int readDist(); }; #endif