]> git.donarmstrong.com Git - mothur.git/blobdiff - hcluster.h
worked on hcluster. made .single command run using a sharedfile. and various other...
[mothur.git] / hcluster.h
index 065d559d1223865313b95a32f20dd6fb14fc5fc0..679abbc2cc19e54f5a3028155de3d6d18372d937 100644 (file)
 class RAbundVector;
 class ListVector;
 
+/***********************************************************************/
+struct linkNode {
+       int     links;
+       float dist;
+       
+       linkNode() {};
+       linkNode(int l, float a) : links(l), dist(a) {};
+       ~linkNode() {};
+};
+
 /***********************************************************************/
 class HCluster {
        
 public:
-       HCluster(RAbundVector*, ListVector*, string);
+       HCluster(RAbundVector*, ListVector*, string, string, NameAssignment*, float);
        ~HCluster(){};
-    void update(int, int, float);
+    bool update(int, int, float);
        void setMapWanted(bool m); 
        map<string, int> getSeqtoBin()  {  return seq2Bin;      }
-       vector<seqDist> getSeqs(ifstream&, NameAssignment*, float);
+       vector<seqDist> getSeqs();
 
 protected:     
        void clusterBins();
@@ -36,24 +46,39 @@ protected:
        void printInfo();
        void updateArrayandLinkTable();
        void updateMap();
+       vector<seqDist> getSeqsFNNN();
+       vector<seqDist> getSeqsAN();
+       void combineFile();
+       void processFile();
+       seqDist getNextDist(char*, int&, int);
                
        RAbundVector* rabund;
        ListVector* list;
+       NameAssignment* nameMap;
        
        vector<clusterNode> clusterArray;
+       
+       //note: the nearest and average neighbor method do not use the link table or active links
        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
        map<int, int> activeLinks;  //maps sequence to index in linkTable
        map<int, int>::iterator it;
+       map<int, int>::iterator itActive;
+       map<int, int>::iterator it2Active;
        map<int, int>::iterator it2;
        
        int numSeqs;
        int smallRow;
        int smallCol;
-       float smallDist;
+       float smallDist, cutoff;
        map<string, int> seq2Bin;
-       bool mapWanted, exitedBreak;
+       bool mapWanted, exitedBreak, firstRead;
        seqDist next;
-       string method;
+       string method, distfile;
+       ifstream filehandle;
+       
+       vector<seqDist> mergedMin;
+       string partialDist;
+       
        
 };