]> git.donarmstrong.com Git - mothur.git/blobdiff - preclustercommand.h
finished added bygroup processing of chimeras in chimera.slayer and chimera.uchime...
[mothur.git] / preclustercommand.h
index bb666cdd1bd93fd9b17740e69d68d7a5ec2ff1ff..38bcd37cf1ffc33a8ee3572c6f24053e1372c1fc 100644 (file)
 struct seqPNode {
        int numIdentical;
        Sequence seq;
+       string names;
+       bool active;
        seqPNode() {}
-       seqPNode(int s, Sequence q) : numIdentical(s), seq(q) {}
+       seqPNode(int n, Sequence s, string nm) : numIdentical(n), seq(s), names(nm), active(1) {}
        ~seqPNode() {}
 };
 /************************************************************/
@@ -28,24 +30,40 @@ struct seqPNode {
 class PreClusterCommand : public Command {
        
 public:
-       PreClusterCommand(string);      
-       ~PreClusterCommand();
-       int execute();  
-       void help();
+       PreClusterCommand(string);
+       PreClusterCommand();
+       ~PreClusterCommand(){}
+       
+       vector<string> setParameters();
+       string getCommandName()                 { return "pre.cluster";                         }
+       string getCommandCategory()             { return "Sequence Processing";         }
+       string getHelpString(); 
+       string getCitation() { return "http://www.mothur.org/wiki/Pre.cluster"; }
+       string getDescription()         { return "implements a pseudo-single linkage algorithm with the goal of removing sequences that are likely due to pyrosequencing errors"; }
+
+       
+       int execute(); 
+       void help() { m->mothurOut(getHelpString()); }  
        
 private:
        int diffs, length;
-       bool abort;
-       string fastafile, namefile;
+       bool abort, bygroup;
+       string fastafile, namefile, outputDir, groupfile;
        vector<seqPNode> alignSeqs; //maps the number of identical seqs to a sequence
        map<string, string> names; //represents the names file first column maps to second column
        map<string, int> sizes;  //this map a seq name to the number of identical seqs in the names file
-       map<string, bool> active; //maps sequence name to whether it has already been merged or not.
+       map<string, int>::iterator itSize; 
+//     map<string, bool> active; //maps sequence name to whether it has already been merged or not.
+       vector<string> outputNames;
+       map<string, vector<string> > outputTypes;
        
-       int readSeqs();
-       int calcMisMatches(string, string);
+       int readFASTA();
        void readNameFile();
+       //int readNamesFASTA();
+       int calcMisMatches(string, string);
        void printData(string, string); //fasta filename, names file name
+       int process();
+       int loadSeqs(map<string, string>&, vector<Sequence>&);
 };
 
 /************************************************************/