]> git.donarmstrong.com Git - mothur.git/blob - hcluster.h
added modify names parameter to set.dir
[mothur.git] / hcluster.h
1 #ifndef HCLUSTER_H
2 #define HCLUSTER_H
3
4 /*
5  *  hcluster.h
6  *  Mothur
7  *
8  *  Created by westcott on 10/13/09.
9  *  Copyright 2009 Schloss Lab. All rights reserved.
10  *
11  */
12
13
14 #include "mothur.h"
15 #include "nameassignment.hpp"
16
17 class RAbundVector;
18 class ListVector;
19
20 /***********************************************************************/
21 class HCluster {
22         
23 public:
24         HCluster(RAbundVector*, ListVector*, string, string, NameAssignment*, float);
25         ~HCluster(){};
26     double update(int, int, float);
27         void setMapWanted(bool m); 
28         map<string, int> getSeqtoBin()  {  return seq2Bin;      }
29         vector<seqDist> getSeqs();
30
31 protected:      
32         void clusterBins();
33         void clusterNames();
34         int getUpmostParent(int);
35         int makeActive();
36         void printInfo();
37         void updateArrayandLinkTable();
38         void updateMap();
39         vector<seqDist> getSeqsFNNN();
40         vector<seqDist> getSeqsAN();
41         int combineFile();
42         int processFile();
43         //seqDist getNextDist(char*, int&, int);
44                 
45         RAbundVector* rabund;
46         ListVector* list;
47         NameAssignment* nameMap;
48         
49         vector<clusterNode> clusterArray;
50         
51         //note: the nearest and average neighbor method do not use the link table or active links
52         vector< map<int, int> > linkTable;  // vector of maps - linkTable[1][6] = 2  would mean sequence in spot 1 has 2 links with sequence in 6
53         map<int, int> activeLinks;  //maps sequence to index in linkTable
54         map<int, int>::iterator it;
55         map<int, int>::iterator itActive;
56         map<int, int>::iterator it2Active;
57         map<int, int>::iterator it2;
58         
59         int numSeqs;
60         int smallRow;
61         int smallCol;
62         float smallDist, cutoff;
63         map<string, int> seq2Bin;
64         bool mapWanted, exitedBreak;
65         seqDist next;
66         string method, distfile;
67         ifstream filehandle;
68         
69         vector<seqDist> mergedMin;
70         string partialDist;
71         MothurOut* m;
72         
73         
74 };
75
76 /***********************************************************************/
77
78
79
80
81
82
83
84 #endif
85
86