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