]> git.donarmstrong.com Git - mothur.git/blob - sharedcommand.h
added pipeline commands which involved change to command factory and command class...
[mothur.git] / sharedcommand.h
1 #ifndef SHAREDCOMMAND_H
2 #define SHAREDCOMMAND_H
3 /*
4  *  sharedcommand.h
5  *  Dotur
6  *
7  *  Created by Sarah Westcott on 1/2/09.
8  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
9  *
10  */
11
12 #include "command.hpp"
13 #include "sharedlistvector.h"
14 #include "inputdata.h"
15 #include "readotu.h"
16
17 /* The shared() command:
18         The shared command can only be executed after a successful read.shared command.  
19         The shared command parses a .list file and separates it into groups.  
20         It outputs a .shared file containing the OTU information for each group.  
21         There are no shared command parameters.  The shared command should be in the following format: shared(). */
22
23
24 class GlobalData;
25
26 class SharedCommand : public Command {
27         
28 public:
29         SharedCommand(string);  
30         SharedCommand();
31         ~SharedCommand();
32         vector<string> getRequiredParameters();
33         vector<string> getValidParameters();
34         vector<string> getRequiredFiles();
35         map<string, vector<string> > getOutputFiles() { return outputTypes; }
36         int execute();  
37         void help() {}
38         
39 private:
40         void printSharedData(vector<SharedRAbundVector*>);
41         int createMisMatchFile();
42         int readOrderFile();
43         bool isValidGroup(string, vector<string>);
44         int eliminateZeroOTUS(vector<SharedRAbundVector*>&);
45         map<string, vector<string> > outputTypes;
46         
47         GlobalData* globaldata;
48         ReadOTUFile* read;
49         SharedListVector* SharedList;
50         InputData* input;
51         GroupMap* groupMap;
52         vector<string> groups, outputNames, order;
53         ofstream out;
54         string filename, fileroot, outputDir;
55         bool firsttime, pickedGroups;
56         map<string, ofstream*> filehandles;
57         map<string, ofstream*>::iterator it3;
58
59 };
60
61 #endif