]> git.donarmstrong.com Git - mothur.git/blob - preclustercommand.h
modified precluster to use less memory.
[mothur.git] / preclustercommand.h
1 #ifndef PRECLUSTERCOMMAND_H
2 #define PRECLUSTERCOMMAND_H
3
4
5 /*
6  *  preclustercommand.h
7  *  Mothur
8  *
9  *  Created by westcott on 12/21/09.
10  *  Copyright 2009 Schloss Lab. All rights reserved.
11  *
12  */
13
14
15 #include "command.hpp"
16 #include "sequence.hpp"
17
18 /************************************************************/
19 struct seqPNode {
20         int numIdentical;
21         Sequence seq;
22         string names;
23         seqPNode() {}
24         seqPNode(int n, Sequence s, string nm) : numIdentical(n), seq(s), names(nm) {}
25         ~seqPNode() {}
26 };
27 /************************************************************/
28
29 class PreClusterCommand : public Command {
30         
31 public:
32         PreClusterCommand(string);
33         ~PreClusterCommand();
34         int execute();  
35         void help();
36         
37 private:
38         int diffs, length;
39         bool abort;
40         string fastafile, namefile, outputDir;
41         list<seqPNode> alignSeqs; //maps the number of identical seqs to a sequence
42         map<string, string> names; //represents the names file first column maps to second column
43         map<string, int> sizes;  //this map a seq name to the number of identical seqs in the names file
44         map<string, int>::iterator itSize; 
45 //      map<string, bool> active; //maps sequence name to whether it has already been merged or not.
46         
47         int readFASTA();
48         void readNameFile();
49         //int readNamesFASTA();
50         int calcMisMatches(string, string);
51         void printData(ofstream&, ofstream&, seqPNode); //fasta filename, names file name
52 };
53
54 /************************************************************/
55
56
57
58
59
60 #endif
61
62