X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=parsimonycommand.h;h=274cac4e94f46b51aca95695f9fc4d7a4ba9c981;hb=2405cc589aaaf0c44809a48fe98d3b96863dac0b;hp=e093ceb2de8efbbacf2d58e4d46257563b0797c3;hpb=f18d75f9c996cb619a5051a7664620c0c5ae05fb;p=mothur.git diff --git a/parsimonycommand.h b/parsimonycommand.h index e093ceb..274cac4 100644 --- a/parsimonycommand.h +++ b/parsimonycommand.h @@ -13,54 +13,61 @@ #include "parsimony.h" #include "treemap.h" #include "progress.hpp" +#include "sharedutilities.h" +#include "fileoutput.h" +#include "readtree.h" -using namespace std; - -class GlobalData; class ParsimonyCommand : public Command { + +public: + ParsimonyCommand(string); + ParsimonyCommand(); + ~ParsimonyCommand(){} - public: - ParsimonyCommand(); - ~ParsimonyCommand() { delete pars; } - int execute(); + vector setParameters(); + string getCommandName() { return "parsimony"; } + string getCommandCategory() { return "Hypothesis Testing"; } + string getHelpString(); + + int execute(); + void help() { m->mothurOut(getHelpString()); } + +private: + ReadTree* read; + SharedUtil* util; + FileOutput* output; + vector T; //user trees + Tree* randT; //random tree + Tree* copyUserTree; + TreeMap* tmap; + TreeMap* savetmap; + Parsimony* pars; + vector groupComb; // AB. AC, BC... + string sumFile, randomtree, allGroups, outputDir, treefile, groupfile, namefile; + int iters, numGroups, numComp, counter, processors, numUniquesInName; + vector numEachGroup; //vector containing the number of sequences in each group the users wants for random distrib. + vector< vector > userTreeScores; //scores for users trees for each comb. + vector< vector > UScoreSig; //tree score signifigance when compared to random trees - percentage of random trees with that score or lower. + EstOutput userData; //pscore info for user tree + EstOutput randomData; //pscore info for random trees + map validScores; //map contains scores from both user and random + vector< map > rscoreFreq; //map -vector entry for each combination. + vector< map > uscoreFreq; //map -vector entry for each combination. + vector< map > rCumul; //map -vector entry for each combination. + vector< map > uCumul; //map -vector entry for each combination. + + ofstream outSum; + bool abort; + string groups, itersString; + vector Groups, outputNames; //holds groups to be used + map nameMap; + + void printParsimonyFile(); + int printUSummaryFile(); + void getUserInput(); + int readNamesFile(); - private: - GlobalData* globaldata; - vector T; //user trees - Tree* randT; //random tree - Tree* copyUserTree; - TreeMap* tmap; - TreeMap* savetmap; - Parsimony* pars; - vector groupComb; // AB. AC, BC... - string parsFile, parsFileout, sumFile, randomtree; - int iters, numGroups, numComp, counter; - vector numEachGroup; //vector containing the number of sequences in each group the users wants for random distrib. - vector< vector > userTreeScores; //scores for users trees for each comb. - vector< vector > UScoreSig; //tree score signifigance when compared to random trees - percentage of random trees with that score or lower. - EstOutput userData; //pscore info for user tree - EstOutput randomData; //pscore info for random trees - map validScores; //map contains scores from both user and random - vector< map > rscoreFreq; //map -vector entry for each combination. - vector< map > uscoreFreq; //map -vector entry for each combination. - vector< map > rCumul; //map -vector entry for each combination. - vector< map > uCumul; //map -vector entry for each combination. - map::iterator it; - map::iterator it2; - - ofstream out, outSum; - ifstream inFile; - - void printParsimonyFile(); - void printUSummaryFile(); - void getUserInput(); - void setGroups(); - void initFile(string); - void output(vector); - void resetFile(); - - };