1 #ifndef SUMMARYSHAREDCOMMAND_H
2 #define SUMMARYSHAREDCOMMAND_H
4 * summarysharedcommand.h
7 * Created by Sarah Westcott on 1/2/09.
8 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
13 #include "command.hpp"
14 #include "sharedrabundvector.h"
15 #include "inputdata.h"
16 #include "calculator.h"
18 #include "validcalculator.h"
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. */
37 class SummarySharedCommand : public Command {
40 SummarySharedCommand(string);
41 ~SummarySharedCommand();
46 GlobalData* globaldata;
48 vector<Calculator*> sumCalculators;
50 ValidCalculators* validCalculator;
51 SharedListVector* SharedList;
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*>);