]> git.donarmstrong.com Git - mothur.git/commitdiff
changed cluster.classic so that it does not adjust the cutoff
authorwestcott <westcott>
Tue, 2 Nov 2010 16:30:16 +0000 (16:30 +0000)
committerwestcott <westcott>
Tue, 2 Nov 2010 16:30:16 +0000 (16:30 +0000)
clusterclassic.cpp
clusterdoturcommand.cpp
makefile
mothur
normalizesharedcommand.cpp

index d0a63b1e2e4d47782839844595727d4420a9e873..41c1647bccf6196efb54b31333a7d5298feaaeed 100644 (file)
@@ -17,7 +17,7 @@ ClusterClassic::ClusterClassic(float c, string f) : method(f), smallDist(1e6), n
        
                //save so you can modify as it changes in average neighbor
                cutoff = c;
-               aboveCutoff = cutoff + 1.0;
+               aboveCutoff = cutoff + 10000.0;
                m = MothurOut::getInstance();
                globaldata = GlobalData::getInstance();
        }
@@ -104,12 +104,12 @@ int ClusterClassic::readPhylipFile(string filename, NameAssignment* nameMap) {
                                                                                if (distance == -1) { distance = 1000000; }
                                                                                else if (globaldata->sim) { distance = 1.0 - distance;  }  //user has entered a sim matrix that we need to convert.
                                                                
-                                                                               if(distance < cutoff){
+                                                                               //if(distance < cutoff){
                                                                                        dMatrix[i][j] = distance;
                                                                                        if (distance < smallDist) { smallDist = distance; }
                                                                                        //if (rowSmallDists[i].dist > distance) {  rowSmallDists[i].dist = distance; rowSmallDists[i].col = j; rowSmallDists[i].row = i; }
                                                                                        //if (rowSmallDists[j].dist > distance) {  rowSmallDists[j].dist = distance; rowSmallDists[j].col = i; rowSmallDists[j].row = j; }
-                                                                               }
+                                                                               //}
                                                                                index++;
                                                                                reading->update(index);
                                                                }
@@ -126,7 +126,7 @@ int ClusterClassic::readPhylipFile(string filename, NameAssignment* nameMap) {
                                                                                if (distance == -1) { distance = 1000000; }
                                                                                else if (globaldata->sim) { distance = 1.0 - distance;  }  //user has entered a sim matrix that we need to convert.
                                                                                
-                                                                               if(distance < cutoff){
+                                                                               //if(distance < cutoff){
                                                                                        if (distance < smallDist) { smallDist = distance; }
                                                                                        
                                                                                        int row = nameMap->get(matrixNames[i]);
@@ -137,7 +137,7 @@ int ClusterClassic::readPhylipFile(string filename, NameAssignment* nameMap) {
                                                                                        
                                                                                        //if (rowSmallDists[row].dist > distance) {  rowSmallDists[row].dist = distance; rowSmallDists[row].col = col; rowSmallDists[row].row = row; }
                                                                                        //if (rowSmallDists[col].dist > distance) {  rowSmallDists[col].dist = distance; rowSmallDists[col].col = row; rowSmallDists[col].row = col; }
-                                                                               }
+                                                                               //}
                                                                                index++;
                                                                                reading->update(index);
                                                                }
@@ -164,7 +164,7 @@ int ClusterClassic::readPhylipFile(string filename, NameAssignment* nameMap) {
                                                                                if (distance == -1) { distance = 1000000; }
                                                                                else if (globaldata->sim) { distance = 1.0 - distance;  }  //user has entered a sim matrix that we need to convert.
                                                                                
-                                                                               if(distance < cutoff && j < i){
+                                                                               if(j < i){
                                                                                        if (distance < smallDist) { smallDist = distance; }
                                                                                        
                                                                                        dMatrix[i][j] = distance;
@@ -187,7 +187,7 @@ int ClusterClassic::readPhylipFile(string filename, NameAssignment* nameMap) {
                                                                           if (distance == -1) { distance = 1000000; }
                                                                                else if (globaldata->sim) { distance = 1.0 - distance;  }  //user has entered a sim matrix that we need to convert.                                                        
                                                                                
-                                                                               if(distance < cutoff && j < i){
+                                                                               if(j < i){
                                                                                        if (distance < smallDist) { smallDist = distance; }
                                                                                        
                                                                                        int row = nameMap->get(matrixNames[i]);
@@ -342,32 +342,12 @@ void ClusterClassic::update(double& cutOFF){
                                        newDist = max(distRow, distCol);
                                }
                                else if (method == "average"){
-                                       if ((distRow == aboveCutoff) && (distCol == aboveCutoff)) { //you are merging with a value above cutoff
-                                               newDist = aboveCutoff; //eliminate value
-                                       }else if ((distRow == aboveCutoff) && (distCol != aboveCutoff)) { //you are merging with a value above cutoff
-                                               newDist = aboveCutoff; //eliminate value
-                                               if (cutOFF > distCol) { cutOFF = distCol; }
-                                       }else if ((distRow != aboveCutoff) && (distCol == aboveCutoff)) { //you are merging with a value above cutoff
-                                               newDist = aboveCutoff; //eliminate value
-                                               if (cutOFF > distRow) { cutOFF = distRow; }
-                                       }else {
-                                               int rowBin = rabund->get(r);
-                                               int colBin = rabund->get(c);
-                                               newDist = (colBin * distCol + rowBin * distRow) / (rowBin + colBin);
-                                       }
+                                       int rowBin = rabund->get(r);
+                                       int colBin = rabund->get(c);
+                                       newDist = (colBin * distCol + rowBin * distRow) / (rowBin + colBin);
                                }
                                else if (method == "weighted"){
-                                       if ((distRow == aboveCutoff) && (distCol == aboveCutoff)) { //you are merging with a value above cutoff
-                                               newDist = aboveCutoff; //eliminate value
-                                       }else if ((distRow == aboveCutoff) && (distCol != aboveCutoff)) { //you are merging with a value above cutoff
-                                               newDist = aboveCutoff; //eliminate value
-                                               if (cutOFF > distCol) { cutOFF = distCol; }
-                                       }else if ((distRow != aboveCutoff) && (distCol == aboveCutoff)) { //you are merging with a value above cutoff
-                                               newDist = aboveCutoff; //eliminate value
-                                               if (cutOFF > distRow) { cutOFF = distRow; }
-                                       }else {
-                                               newDist = (distCol + distRow) / 2.0;
-                                       }
+                                       newDist = (distCol + distRow) / 2.0;
                                }
                                else if (method == "nearest"){
                                        newDist = min(distRow, distCol);
index 21840e482d4ccadcd138f35f4ef9fda1e0f7881c..4987d4e9305b86496e9d7655a62d27e6a1c779a2 100644 (file)
@@ -223,7 +223,7 @@ int ClusterDoturCommand::execute(){
                oldRAbund = *rabund;
                oldList = *list;
 
-               double saveCutoff = cutoff;
+               //double saveCutoff = cutoff;
                
                int estart = time(NULL);
        
@@ -266,11 +266,11 @@ int ClusterDoturCommand::execute(){
                
                delete cluster; delete nameMap; delete list; delete rabund;
        
-               if (saveCutoff != cutoff) { 
-                       if (hard)       {  saveCutoff = m->ceilDist(saveCutoff, precision);     }
-                       else            {       saveCutoff = m->roundDist(saveCutoff, precision);  }
-                       m->mothurOut("changed cutoff to " + toString(cutoff)); m->mothurOutEndLine(); 
-               }
+               //if (saveCutoff != cutoff) { 
+               //      if (hard)       {  saveCutoff = m->ceilDist(saveCutoff, precision);     }
+               //      else            {       saveCutoff = m->roundDist(saveCutoff, precision);  }
+               //      m->mothurOut("changed cutoff to " + toString(cutoff)); m->mothurOutEndLine(); 
+               //}
                
                m->mothurOutEndLine();
                m->mothurOut("Output File Names: "); m->mothurOutEndLine();
index 3d0e18de0e40d3b035f101c857c6def36e8cbdfd..583d4ad2298171fb5045ecc3fed59a520934a25b 100644 (file)
--- a/makefile
+++ b/makefile
@@ -30,7 +30,7 @@ endif
 
 MOTHUR_FILES = "\"../release\""
 
-RELEASE_DATE = "\"10/26/2010\""
+RELEASE_DATE = "\"11/02/2010\""
 VERSION = "\"1.14.0\""
 
 CXXFLAGS += -DRELEASE_DATE=${RELEASE_DATE} -DVERSION=${VERSION}
diff --git a/mothur b/mothur
index fcb006d68a694becb92b5adcdf4a414946782ff6..b0584ed9528306140df5d6667109738ff65f46ce 100755 (executable)
Binary files a/mothur and b/mothur differ
index 8aec029d9ec718327cc8c2e677f215e7b9e5cc88..16b9732ebdb25e936bbda1537825467f400cf079 100644 (file)
@@ -310,7 +310,8 @@ int NormalizeSharedCommand::normalize(vector<SharedRAbundVector*>& thisLookUp, o
                                        float newNorm = relabund * norm;
                                        //round to nearest int
                                        finalNorm = (int) floor((newNorm + 0.5));
-                                       
+                                       //cout << thisLookUp[i]->getGroup() << '\t' << abund << '\t' << relabund << '\t' << norm << '\t' << newNorm << '\t' << finalNorm << endl;
+                               
                                }else{ m->mothurOut(method + " is not a valid scaling option."); m->mothurOutEndLine(); m->control_pressed = true; return 0; }
                                
                                //cout << finalNorm << '\t';