method = validParameter.validFile(parameters, "method", false);
if (method == "not found") { method = "furthest"; }
- if ((method == "furthest") || (method == "nearest") || (method == "average")) { }
- else { m->mothurOut("Not a valid clustering method. Valid clustering algorithms are furthest, nearest or average."); m->mothurOutEndLine(); abort = true; }
+ if ((method == "furthest") || (method == "nearest") || (method == "average") || (method == "weighted")) { }
+ else { m->mothurOut("Not a valid clustering method. Valid clustering algorithms are furthest, nearest, average, and weighted."); m->mothurOutEndLine(); abort = true; }
showabund = validParameter.validFile(parameters, "showabund", false);
if (showabund == "not found") { showabund = "T"; }
if (method == "furthest") { cluster = new CompleteLinkage(rabund, list, matrix, cutoff, method); }
else if(method == "nearest"){ cluster = new SingleLinkage(rabund, list, matrix, cutoff, method); }
else if(method == "average"){ cluster = new AverageLinkage(rabund, list, matrix, cutoff, method); }
+ else if(method == "weighted"){ cluster = new WeightedLinkage(rabund, list, matrix, cutoff, method); }
tag = cluster->getTag();
if (outputDir == "") { outputDir += hasPath(globaldata->inputFileName); }
rabundFile.close();
listFile.close();
- if (saveCutoff != cutoff) { m->mothurOut("changed cutoff to " + toString(cutoff)); m->mothurOutEndLine(); }
+ if (saveCutoff != cutoff) {
+ if (hard) { saveCutoff = ceilDist(saveCutoff, precision); }
+ else { saveCutoff = roundDist(saveCutoff, precision); }
+
+ m->mothurOut("changed cutoff to " + toString(cutoff)); m->mothurOutEndLine();
+ }
m->mothurOutEndLine();
m->mothurOut("Output File Names: "); m->mothurOutEndLine();