]> git.donarmstrong.com Git - mothur.git/blob - rarefactsharedcommand.h
Merge branch 'master' of https://github.com/mothur/mothur.git into development
[mothur.git] / rarefactsharedcommand.h
1 #ifndef RAREFACTSHAREDCOMMAND_H
2 #define RAREFACTSHAREDCOMMAND_H
3 /*
4  *  rarefactsharedcommand.h
5  *  Dotur
6  *
7  *  Created by Sarah Westcott on 1/6/09.
8  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
9  *
10  */
11
12 #include "command.hpp"
13 #include "inputdata.h"
14 #include "rarefact.h"
15 #include "display.h"
16 #include "validcalculator.h"
17
18 class RareFactSharedCommand : public Command {
19         
20 public:
21         RareFactSharedCommand(string);
22         RareFactSharedCommand();
23         ~RareFactSharedCommand() {}
24         
25         vector<string> setParameters();
26         string getCommandName()                 { return "rarefaction.shared";          }
27         string getCommandCategory()             { return "OTU-Based Approaches";        }
28         string getOutputFileNameTag(string, string);
29         string getHelpString(); 
30         string getCitation() { return "Magurran AE (2004). Measuring biological diversity. Blackwell Pub.: Malden, Ma. \nhttp://www.mothur.org/wiki/Rarefaction.shared"; }
31         string getDescription()         { return "generate inter-sample rarefaction curves using a re-sampling without replacement approach"; }
32
33         int execute(); 
34         void help() { m->mothurOut(getHelpString()); }  
35         
36         
37 private:
38         
39         vector<SharedRAbundVector*> lookup;
40         int nIters, subsampleSize, iters;
41         string format;
42         float freq;
43         
44      map<int, string> file2Group; //index in outputNames[i] -> group
45         bool abort, allLines, jumble, groupMode, subsample;
46         set<string> labels; //holds labels to be used
47         string label, calc, groups, outputDir, sharedfile, designfile;
48         vector<string>  Estimators, Groups, outputNames, Sets;
49     
50     int process(GroupMap&, string);
51     vector<string> createGroupFile(vector<string>&);
52     int subsampleLookup(vector<SharedRAbundVector*>&, string);
53
54 };
55
56 #endif