]> git.donarmstrong.com Git - mothur.git/blobdiff - amovacommand.h
added modify names parameter to set.dir
[mothur.git] / amovacommand.h
index 3b90b967437df2c0ad360675fc89537976dce989..98d19ddfc249d550c5d6d5b7c33cf036642393a0 100644 (file)
  */
 
 #include "command.hpp"
-#include "inputdata.h"
-#include "sharedrabundvector.h"
-#include "validcalculator.h"
-#include "readphylipvector.h"
-
-class GlobalData;
+class GroupMap;
 
 class AmovaCommand : public Command {
        
 public:
        AmovaCommand(string);
        AmovaCommand();
-       ~AmovaCommand();
-       vector<string> getRequiredParameters();
-       vector<string> getValidParameters();
-       vector<string> getRequiredFiles();
-       map<string, vector<string> > getOutputFiles() { return outputTypes; }
-       int execute();
-       void help();
+       ~AmovaCommand() {}
        
-private:
-       struct linePair {
-               int start;
-               int num;
-               linePair(int i, int j) : start(i), num(j) {}
-       };
-       vector<linePair> lines;
+       vector<string> setParameters();
+       string getCommandName()                 { return "amova";                                       }
+       string getCommandCategory()             { return "Hypothesis Testing";          }
        
-       GlobalData* globaldata;
-       GroupMap* designMap;
-       map<string, vector<string> > outputTypes;
+       string getHelpString(); 
+    string getOutputPattern(string);   
+    string getCitation() { return "Anderson MJ (2001). A new method for non-parametric multivariate analysis of variance. Austral Ecol 26: 32-46.\nhttp://www.mothur.org/wiki/Amova"; }
+       string getDescription()         { return "analysis of molecular variance"; }
        
-       vector< vector<double> > matrix;
-       bool abort, allLines, pickedGroups;
-       set<string> labels; //holds labels to be used
-       string format, groups, label, outputDir, inputDir, designfile, sets, phylipfile, calc, sharedfile;
-       vector<string> Groups, outputNames, Sets;
-       vector< vector<string> > namesOfGroupCombos;
-       int iters, processors;
-       vector<Calculator*> calculators;
+       int execute();
+       void help() { m->mothurOut(getHelpString()); }
        
-       int driver(int, int, vector<SharedRAbundVector*>, string);
-       int driver(int, int, vector<string>, string, vector< vector<double> >&);
-       int process(vector<SharedRAbundVector*>);
-       int calcAmova(ofstream&, int, vector<string>);
-       double calcWithin(vector< vector<double> >&, int, vector<string>);
-       double calcTotal(int);
+private:
+       double runAMOVA(ofstream&, map<string, vector<int> >, double);
+       double calcSSWithin(map<string, vector<int> >&);
+       double calcSSTotal(map<string, vector<int> >&);
+       map<string, vector<int> > getRandomizedGroups(map<string, vector<int> >);
+
+       bool abort;
+       vector<string> outputNames, Sets;
+
+       string outputDir, inputDir, designFileName, phylipFileName;
+       GroupMap* designMap;
+       vector< vector<double> > distanceMatrix;
+       int iters;
+       double experimentwiseAlpha;
 };
 
 #endif