]> git.donarmstrong.com Git - mothur.git/blob - amovacommand.h
added amova command
[mothur.git] / amovacommand.h
1 #ifndef AMOVACOMMAND_H
2 #define AMOVACOMMAND_H
3
4 /*
5  *  amovacommand.h
6  *  mothur
7  *
8  *  Created by westcott on 2/7/11.
9  *  Copyright 2011 Schloss Lab. All rights reserved.
10  *
11  */
12
13 #include "command.hpp"
14 #include "inputdata.h"
15 #include "sharedrabundvector.h"
16 #include "validcalculator.h"
17 #include "readphylipvector.h"
18
19 class GlobalData;
20
21 class AmovaCommand : public Command {
22         
23 public:
24         AmovaCommand(string);
25         AmovaCommand();
26         ~AmovaCommand();
27         vector<string> getRequiredParameters();
28         vector<string> getValidParameters();
29         vector<string> getRequiredFiles();
30         map<string, vector<string> > getOutputFiles() { return outputTypes; }
31         int execute();
32         void help();
33         
34 private:
35         struct linePair {
36                 int start;
37                 int num;
38                 linePair(int i, int j) : start(i), num(j) {}
39         };
40         vector<linePair> lines;
41         
42         GlobalData* globaldata;
43         GroupMap* designMap;
44         map<string, vector<string> > outputTypes;
45         
46         vector< vector<double> > matrix;
47         bool abort, allLines, pickedGroups;
48         set<string> labels; //holds labels to be used
49         string format, groups, label, outputDir, inputDir, designfile, sets, phylipfile, calc, sharedfile;
50         vector<string> Groups, outputNames, Sets;
51         vector< vector<string> > namesOfGroupCombos;
52         int iters, processors;
53         vector<Calculator*> calculators;
54         
55         int driver(int, int, vector<SharedRAbundVector*>, string);
56         int driver(int, int, vector<string>, string, vector< vector<double> >&);
57         int process(vector<SharedRAbundVector*>);
58         int calcAmova(ofstream&, int, vector<string>);
59         double calcWithin(vector< vector<double> >&, int, vector<string>);
60         double calcTotal(int);
61 };
62
63 #endif
64