]> git.donarmstrong.com Git - mothur.git/blob - mgclustercommand.h
Merge remote-tracking branch 'origin/master'
[mothur.git] / mgclustercommand.h
1 #ifndef MGCLUSTERCOMMAND_H
2 #define MGCLUSTERCOMMAND_H
3
4 /*
5  *  mgclustercommand.h
6  *  Mothur
7  *
8  *  Created by westcott on 12/11/09.
9  *  Copyright 2009 Schloss Lab. All rights reserved.
10  *
11  */
12
13 #include "command.hpp"
14 #include "readblast.h"
15 #include "sparsematrix.hpp"
16 #include "nameassignment.hpp"
17 #include "cluster.hpp"
18 #include "hcluster.h"
19 #include "rabundvector.hpp"
20 #include "sabundvector.hpp"
21 #include "counttable.h"
22
23 /**********************************************************************/
24
25 class MGClusterCommand : public Command {
26
27 public:
28         MGClusterCommand(string);
29         MGClusterCommand();
30         ~MGClusterCommand(){}
31         
32         vector<string> setParameters();
33         string getCommandName()                 { return "mgcluster";   }
34         string getCommandCategory()             { return "Clustering";  }
35         string getOutputFileNameTag(string, string);
36         string getHelpString(); 
37         string getCitation() { return "Schloss PD, Handelsman J (2008). A statistical toolbox for metagenomics. BMC Bioinformatics 9: 34. \nhttp://www.mothur.org/wiki/Mgcluster"; }
38         string getDescription()         { return "cluster your sequences into OTUs using a blast file"; }
39
40         int execute(); 
41         void help() { m->mothurOut(getHelpString()); }  
42         
43         
44 private:
45         ReadBlast* read;
46         NameAssignment* nameMap;
47         Cluster* cluster;
48         HCluster* hcluster;
49         ListVector* list;
50     CountTable* ct;
51         ListVector oldList;
52     RAbundVector rav;
53         vector<seqDist> overlapMatrix;
54         vector<string> outputNames;
55         
56         string blastfile, method, namefile, countfile, overlapFile, distFile, outputDir;
57         ofstream sabundFile, rabundFile, listFile;
58         double cutoff;
59         float penalty;
60         int precision, length, precisionLength;
61         bool abort, minWanted, hclusterWanted, merge, hard, large;
62         
63         void printData(ListVector*);
64         ListVector* mergeOPFs(map<string, int>, float);
65         void sortHclusterFiles(string, string);
66         vector<seqDist> getSeqs(ifstream&);
67     void createRabund(CountTable*, ListVector*);
68
69 };
70
71 /**********************************************************************/
72
73 #endif
74
75
76