]> git.donarmstrong.com Git - mothur.git/blob - subsamplecommand.h
changed normalize.shared and sub.sample commands to fix bug in normalize.shared and...
[mothur.git] / subsamplecommand.h
1 #ifndef SUBSAMPLECOMMAND_H
2 #define SUBSAMPLECOMMAND_H
3
4 /*
5  *  subsamplecommand.h
6  *  Mothur
7  *
8  *  Created by westcott on 10/27/10.
9  *  Copyright 2010 Schloss Lab. All rights reserved.
10  *
11  */
12  
13 #include "command.hpp"
14 #include "sharedrabundvector.h"
15 #include "listvector.hpp"
16 #include "rabundvector.hpp"
17 #include "inputdata.h"
18 #include "sequence.hpp"
19
20
21 class SubSampleCommand : public Command {
22
23 public:
24         SubSampleCommand(string);
25         SubSampleCommand();
26         ~SubSampleCommand() {}
27         
28         vector<string> setParameters();
29         string getCommandName()                 { return "sub.sample";  }
30         string getCommandCategory()             { return "General";             }
31         string getHelpString(); 
32         string getCitation() { return "http://www.mothur.org/wiki/Sub.sample"; }
33         string getDescription()         { return "get a sampling of sequences from a list, shared, rabund, sabund or fasta file"; }
34
35         int execute(); 
36         void help() { m->mothurOut(getHelpString()); }  
37         
38 private:        
39         bool abort, pickedGroups, allLines, persample;
40         string listfile, groupfile, sharedfile, rabundfile, sabundfile, fastafile, namefile;
41         set<string> labels; //holds labels to be used
42         string groups, label, outputDir;
43         vector<string> Groups, outputNames;
44         int size;
45         vector<string> names;
46         map<string, vector<string> > nameMap;
47         
48         int eliminateZeroOTUS(vector<SharedRAbundVector*>&);
49         int getSubSampleShared();
50         int getSubSampleList();
51         int getSubSampleRabund();
52         int getSubSampleSabund();
53         int getSubSampleFasta();
54         int processShared(vector<SharedRAbundVector*>&);
55         int processRabund(RAbundVector*&, ofstream&);
56         int processSabund(SAbundVector*&, ofstream&);
57         int processList(ListVector*&, ofstream&, set<string>&);
58         int getNames();
59         int readNames();
60         
61 };
62
63 #endif
64