]> git.donarmstrong.com Git - mothur.git/blobdiff - cluster.hpp
Merge remote-tracking branch 'origin/master'
[mothur.git] / cluster.hpp
index 99d8b7d557a41cef684ad2f9aae7d636d621bbc7..d7c2737a05ed1a0198be9713aa4345f288ec3976 100644 (file)
@@ -4,6 +4,7 @@
 
 #include "mothur.h"
 #include "sparsematrix.hpp"
+#include "mothurout.h"
 
 class RAbundVector;
 class ListVector;
@@ -13,9 +14,11 @@ typedef vector<MatData> MatVec;
 class Cluster {
        
 public:
-       Cluster(RAbundVector*, ListVector*, SparseMatrix*);
-    virtual void update();
+       Cluster(RAbundVector*, ListVector*, SparseMatrix*, float, string);
+    virtual void update(double&);                              
        virtual string getTag() = 0;
+       virtual void setMapWanted(bool m);  
+       virtual map<string, int> getSeqtoBin()  {  return seq2Bin;      }
 
 protected:     
        void getRowColCells();
@@ -25,6 +28,7 @@ protected:
 
        virtual void clusterBins();
        virtual void clusterNames();
+       virtual void updateMap();
        
        RAbundVector* rabund;
        ListVector* list;
@@ -33,19 +37,24 @@ protected:
        int smallRow;
        int smallCol;
        float smallDist;
+       bool mapWanted;
+       float cutoff;
+       map<string, int> seq2Bin;
+       string method;
        
-       vector<MatVec> seqVec;          // contains vectors of cells related to a certain sequence\r
+       vector<MatVec> seqVec;          // contains vectors of cells related to a certain sequence
        MatVec rowCells;
        MatVec colCells;
        ull nRowCells;
        ull nColCells;
+       MothurOut* m;
 };
 
 /***********************************************************************/
 
 class CompleteLinkage : public Cluster {
 public:
-       CompleteLinkage(RAbundVector*, ListVector*, SparseMatrix*);
+       CompleteLinkage(RAbundVector*, ListVector*, SparseMatrix*, float, string);
        bool updateDistance(MatData& colCell, MatData& rowCell);
        string getTag();
        
@@ -57,8 +66,8 @@ private:
 
 class SingleLinkage : public Cluster {
 public:
-       SingleLinkage(RAbundVector*, ListVector*, SparseMatrix*);
-    void update();
+       SingleLinkage(RAbundVector*, ListVector*, SparseMatrix*, float, string);
+    void update(double&);
        bool updateDistance(MatData& colCell, MatData& rowCell);
        string getTag();
        
@@ -70,7 +79,7 @@ private:
 
 class AverageLinkage : public Cluster {
 public:
-       AverageLinkage(RAbundVector*, ListVector*, SparseMatrix*);
+       AverageLinkage(RAbundVector*, ListVector*, SparseMatrix*, float, string);
        bool updateDistance(MatData& colCell, MatData& rowCell);
        string getTag();
        
@@ -85,4 +94,17 @@ private:
 
 /***********************************************************************/
 
+class WeightedLinkage : public Cluster {
+public:
+       WeightedLinkage(RAbundVector*, ListVector*, SparseMatrix*, float, string);
+       bool updateDistance(MatData& colCell, MatData& rowCell);
+       string getTag();
+       
+private:
+       int saveRow;
+       int saveCol;    
+};
+
+/***********************************************************************/
+
 #endif