]> git.donarmstrong.com Git - mothur.git/blob - preclustercommand.h
added command descriptions
[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         bool active;
24         seqPNode() {}
25         seqPNode(int n, Sequence s, string nm) : numIdentical(n), seq(s), names(nm), active(1) {}
26         ~seqPNode() {}
27 };
28 /************************************************************/
29
30 class PreClusterCommand : public Command {
31         
32 public:
33         PreClusterCommand(string);
34         PreClusterCommand();
35         ~PreClusterCommand(){}
36         
37         vector<string> setParameters();
38         string getCommandName()                 { return "pre.cluster";                         }
39         string getCommandCategory()             { return "Sequence Processing";         }
40         string getHelpString(); 
41         string getCitation() { return "http://www.mothur.org/wiki/Pre.cluster"; }
42         string getDescription()         { return "implements a pseudo-single linkage algorithm with the goal of removing sequences that are likely due to pyrosequencing errors"; }
43
44         
45         int execute(); 
46         void help() { m->mothurOut(getHelpString()); }  
47         
48 private:
49         int diffs, length;
50         bool abort;
51         string fastafile, namefile, outputDir;
52         vector<seqPNode> alignSeqs; //maps the number of identical seqs to a sequence
53         map<string, string> names; //represents the names file first column maps to second column
54         map<string, int> sizes;  //this map a seq name to the number of identical seqs in the names file
55         map<string, int>::iterator itSize; 
56 //      map<string, bool> active; //maps sequence name to whether it has already been merged or not.
57         vector<string> outputNames;
58         map<string, vector<string> > outputTypes;
59         
60         int readFASTA();
61         void readNameFile();
62         //int readNamesFASTA();
63         int calcMisMatches(string, string);
64         void printData(string, string); //fasta filename, names file name
65 };
66
67 /************************************************************/
68
69
70
71
72
73 #endif
74
75