]> git.donarmstrong.com Git - mothur.git/blob - hclustercommand.h
added hcluster command and fixed some bugs, namely one with smart distancing.
[mothur.git] / hclustercommand.h
1 #ifndef HCLUSTERCOMMAND_H
2 #define HCLUSTERCOMMAND_H
3
4 /*
5  *  hclustercommand.h
6  *  Mothur
7  *
8  *  Created by westcott on 10/13/09.
9  *  Copyright 2009 Schloss Lab. All rights reserved.
10  *
11  */
12
13 #include "command.hpp"
14 #include "globaldata.hpp"
15 #include "hcluster.h"
16 #include "rabundvector.hpp"
17 #include "sabundvector.hpp"
18 #include "listvector.hpp"
19 #include "readcluster.h"
20
21 /******************************************************************/
22 //This command is an implementation of the HCluster algorythmn described in 
23 //ESPRIT: estimating species richness using large collections of 16S rRNA pyrosequences by
24 //Yijun Sun1,2,*, Yunpeng Cai2, Li Liu1, Fahong Yu1, Michael L. Farrell3, William McKendree3 
25 //and William Farmerie1 1 
26
27 //Interdisciplinary Center for Biotechnology Research, 2Department of Electrical and Computer Engineering, 
28 //University of Florida, Gainesville, FL 32610-3622 and 3Materials Technology Directorate, Air Force Technical 
29 //Applications Center, 1030 S. Highway A1A, Patrick AFB, FL 32925-3002, USA 
30 //Received January 28, 2009; Revised April 14, 2009; Accepted April 15, 2009 
31
32 /******************************************************************/
33
34
35 /************************************************************/
36 struct seqDist {
37         int seq1;
38         int seq2;
39         float dist;
40 };
41 /************************************************************/
42 class HClusterCommand : public Command {
43         
44 public:
45         HClusterCommand(string);        
46         ~HClusterCommand();
47         int execute();  
48         void help();
49         
50 private:
51         GlobalData* globaldata;
52         HCluster* cluster;
53         ListVector* list;
54         RAbundVector* rabund;
55         RAbundVector oldRAbund;
56         ListVector oldList;
57         ReadCluster* read;
58         
59         bool abort;
60
61         string method, fileroot, tag, distfile, format, phylipfile, columnfile, namefile, sort;
62         double cutoff;
63         string showabund, timing;
64         int precision, length;
65         ofstream sabundFile, rabundFile, listFile;
66         //ifstream in;
67         seqDist next;
68         bool exitedBreak, sorted;
69
70         bool print_start;
71         time_t start;
72         unsigned long loops;
73         
74         void printData(string label);
75         vector<seqDist> getSeqs(ifstream&);
76 };
77
78 /************************************************************/
79
80 #endif