]> git.donarmstrong.com Git - mothur.git/blob - getoturepcommand.h
broke up globaldata and moved error checking and help into commands
[mothur.git] / getoturepcommand.h
1 #ifndef GETOTUREPCOMMAND_H
2 #define GETOTUREPCOMMAND_H
3 /*
4  *  getoturepcommand.h
5  *  Mothur
6  *
7  *  Created by Sarah Westcott on 4/6/09.
8  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
9  *
10  */
11  
12  /* The get.oturep command outputs a .fastarep file for each distance you specify, selecting one OTU representative for each bin. */
13
14 #include "command.hpp"
15 #include "globaldata.hpp"
16 #include "sparsematrix.hpp"
17 #include "listvector.hpp"
18 #include "inputdata.h"
19 #include "readotu.h"
20 #include "fastamap.h"
21 #include "groupmap.h"
22
23 class GlobalData;
24
25 typedef list<PCell>::iterator MatData;
26
27 class GetOTURepCommand : public Command {
28         
29 public:
30         GetOTURepCommand(string);       
31         ~GetOTURepCommand();
32         int execute();
33         void help();    
34         
35 private:
36         GlobalData* globaldata;
37         SparseMatrix* matrix;
38         ListVector* list;
39         ReadOTUFile* read;
40         InputData* input;
41         FastaMap* fasta;
42         GroupMap* groupMap;
43         string filename, fastafile, listfile, namesfile, groupfile, line, label;
44         ofstream out;
45         ifstream in, inNames;
46         bool groupError;
47         OptionParser* parser;
48         map<string, string> parameters;
49         map<string, string>::iterator it4;
50         bool abort, allLines;
51         set<int> lines; //hold lines to be used
52         set<string> labels; //holds labels to be used
53         map<string, int> nameToIndex;  //maps sequence name to index in sparsematrix
54         map<int, string>::iterator it;
55         map<int, string>::iterator it2;
56         map<string, int>::iterator it3;
57         
58         void readNamesFile();
59         int process(ListVector*);
60         string FindRep(int, string&, ListVector*); // returns name of "representative" sequence of given bin. //and fill a string containing the groups in that bin if a groupfile is given
61
62 };
63
64 #endif
65