]> git.donarmstrong.com Git - mothur.git/blob - summarysharedcommand.h
broke up globaldata and moved error checking and help into commands
[mothur.git] / summarysharedcommand.h
1 #ifndef SUMMARYSHAREDCOMMAND_H
2 #define SUMMARYSHAREDCOMMAND_H
3 /*
4  *  summarysharedcommand.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
13 #include "command.hpp"
14 #include "sharedrabundvector.h"
15 #include "inputdata.h"
16 #include "calculator.h"
17 #include "readotu.h"
18 #include "validcalculator.h"
19
20
21 /*The summary.shared() command
22         The summary.shared command can only be executed after a successful read.shared command. 
23         It outputs a file for each estimator you choose to use.  The summary.shared command parameters are label, 
24         line and sharedsummary.  No parameters are required, but you may not use both the line and label parameters at the same time.  
25         The summary.shared command should be in the following format: summary.shared(label=yourLabel, 
26         line=yourLines, sharedsummary=yourEstimators).  
27         Example summary.shared(label=unique-.01-.03, line=0,5,10, sharedsummary=sharedChao-sharedAce-sharedJabund
28         -sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN).  
29         The default value for sharedsummary is sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN. 
30         The valid sharedsummary estimators are: sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass
31         -sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN.  The label and line parameters are used to analyze specific lines in your input. */
32
33
34 class GlobalData;
35
36
37 class SummarySharedCommand : public Command {
38
39 public:
40         SummarySharedCommand(string);
41         ~SummarySharedCommand();
42         int execute();
43         void help();
44         
45 private:
46         GlobalData* globaldata;
47         ReadOTUFile* read;
48         vector<Calculator*> sumCalculators;     
49         InputData* input;
50         ValidCalculators* validCalculator;
51         SharedListVector* SharedList;
52         OptionParser* parser;
53         map<string, string> parameters;
54         map<string, string>::iterator it;
55         bool abort, allLines, mult;
56         set<int> lines; //hold lines to be used
57         set<string> labels; //holds labels to be used
58         string line, label, calc, groups;
59         vector<string>  Estimators, Groups;
60         vector<SharedRAbundVector*> lookup;
61         string outputFileName, format, outAllFileName;
62         ofstream outputFileHandle, outAll;
63         void process(vector<SharedRAbundVector*>);
64
65 };
66
67 #endif