]> git.donarmstrong.com Git - mothur.git/blob - clusterfragmentscommand.h
added load.logfile command. changed summary.single output for subsample=t.
[mothur.git] / clusterfragmentscommand.h
1 #ifndef CLUSTERFRAGMENTSCOMMAND_H
2 #define CLUSTERFRAGMENTSCOMMAND_H
3
4 /*
5  *  clusterfragmentscommand.h
6  *  Mothur
7  *
8  *  Created by westcott on 9/23/10.
9  *  Copyright 2010 Schloss Lab. All rights reserved.
10  *
11  */
12
13
14 #include "command.hpp"
15 #include "sequence.hpp"
16
17 /************************************************************/
18 struct seqRNode {
19         int numIdentical;
20         int length;
21         Sequence seq;
22         string names;
23         bool active;
24         seqRNode() {}
25         seqRNode(int n, Sequence s, string nm, int l) : numIdentical(n), seq(s), names(nm), active(1), length(l) {}
26         ~seqRNode() {}
27 };
28 /************************************************************/
29
30 class ClusterFragmentsCommand : public Command {
31         
32 public:
33         ClusterFragmentsCommand(string);
34         ClusterFragmentsCommand();
35         ~ClusterFragmentsCommand() {}
36         
37         vector<string> setParameters();
38         string getCommandName()                 { return "cluster.fragments";           }
39         string getCommandCategory()             { return "Sequence Processing";         }
40         string getOutputFileNameTag(string, string);
41         string getHelpString(); 
42         string getCitation() { return "http://www.mothur.org/wiki/Cluster.fragments"; }
43         string getDescription()         { return "creates a namesfile with sequences that are a fragment of a larger sequence"; }
44         
45         int execute(); 
46         void help() { m->mothurOut(getHelpString()); }  
47         
48 private:
49         bool abort;
50         string fastafile, namefile, outputDir;
51         int diffs, percent;
52         vector<seqRNode> alignSeqs; 
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         vector<string> outputNames;
57         
58         int readFASTA();
59         void readNameFile();
60         void printData(string, string); //fasta filename, names file name
61         bool isFragment(string, string);
62         
63 };
64
65 /************************************************************/
66
67 #endif
68