X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=subsamplecommand.h;h=db4001a5c07337d51ea96aedfa9d3f20458b6685;hp=9f3e55bea25c3b47db441d618c80638b1ee2d404;hb=cf9987b67aa49777a4c91c2d21f96e58bf17aa82;hpb=4ad32478c7b1bbb464c839a6e133f5b517a3efec diff --git a/subsamplecommand.h b/subsamplecommand.h index 9f3e55b..db4001a 100644 --- a/subsamplecommand.h +++ b/subsamplecommand.h @@ -11,11 +11,12 @@ */ #include "command.hpp" -#include "globaldata.hpp" #include "sharedrabundvector.h" #include "listvector.hpp" #include "rabundvector.hpp" #include "inputdata.h" +#include "sequence.hpp" +#include "counttable.h" class SubSampleCommand : public Command { @@ -23,38 +24,43 @@ class SubSampleCommand : public Command { public: SubSampleCommand(string); SubSampleCommand(); - ~SubSampleCommand(); - vector getRequiredParameters(); - vector getValidParameters(); - vector getRequiredFiles(); - map > getOutputFiles() { return outputTypes; } - int execute(); - void help(); + ~SubSampleCommand() {} -private: + vector setParameters(); + string getCommandName() { return "sub.sample"; } + string getCommandCategory() { return "Sequence Processing"; } - struct nameToBin { - string name; - int bin; - - nameToBin(string n, int b) : name(n), bin(b) {} - }; - - GlobalData* globaldata; + string getHelpString(); + string getOutputPattern(string); + string getCitation() { return "http://www.mothur.org/wiki/Sub.sample"; } + string getDescription() { return "get a sampling of sequences from a list, shared, rabund, sabund or fasta file"; } + + int execute(); + void help() { m->mothurOut(getHelpString()); } - bool abort, pickedGroups, allLines; - string listfile, groupfile, sharedfile, rabundfile, sabundfile, fastafile, namefile; +private: + bool abort, pickedGroups, allLines, persample; + string listfile, groupfile, countfile, sharedfile, rabundfile, sabundfile, fastafile, namefile, taxonomyfile; set labels; //holds labels to be used string groups, label, outputDir; vector Groups, outputNames; - map > outputTypes; int size; + vector names; + map > nameMap; + CountTable ct; - int eliminateZeroOTUS(vector&); int getSubSampleShared(); int getSubSampleList(); - int processShared(vector&, ofstream&); - int processListGroup(ListVector*&, GroupMap*&, ofstream&, ofstream&); + int getSubSampleRabund(); + int getSubSampleSabund(); + int getSubSampleFasta(); + int processShared(vector&); + int processRabund(RAbundVector*&, ofstream&); + int processSabund(SAbundVector*&, ofstream&); + int processList(ListVector*&, set&); + int getNames(); + int readNames(); + int getTax(set&); };