From: westcott Date: Tue, 2 Nov 2010 16:30:16 +0000 (+0000) Subject: changed cluster.classic so that it does not adjust the cutoff X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=09ce41fb228c00d0f49896c66b2f2c5760914769;p=mothur.git changed cluster.classic so that it does not adjust the cutoff --- diff --git a/clusterclassic.cpp b/clusterclassic.cpp index d0a63b1..41c1647 100644 --- a/clusterclassic.cpp +++ b/clusterclassic.cpp @@ -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); diff --git a/clusterdoturcommand.cpp b/clusterdoturcommand.cpp index 21840e4..4987d4e 100644 --- a/clusterdoturcommand.cpp +++ b/clusterdoturcommand.cpp @@ -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(); diff --git a/makefile b/makefile index 3d0e18d..583d4ad 100644 --- 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 fcb006d..b0584ed 100755 Binary files a/mothur and b/mothur differ diff --git a/normalizesharedcommand.cpp b/normalizesharedcommand.cpp index 8aec029..16b9732 100644 --- a/normalizesharedcommand.cpp +++ b/normalizesharedcommand.cpp @@ -310,7 +310,8 @@ int NormalizeSharedCommand::normalize(vector& 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';