X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=clusterclassic.cpp;h=2d1b9a6b781960a824fddafc03b904e8039179e1;hb=cbaa068e77aeb15bb06f0695a36d8f757977ed64;hp=1ce81c4f2affda469164709f862bb36ff023c163;hpb=91a27e0483827c06c21c4fe89558923bbfe86573;p=mothur.git diff --git a/clusterclassic.cpp b/clusterclassic.cpp index 1ce81c4..2d1b9a6 100644 --- a/clusterclassic.cpp +++ b/clusterclassic.cpp @@ -19,6 +19,10 @@ ClusterClassic::ClusterClassic(float c, string f, bool s) : method(f), smallDist cutoff = c; aboveCutoff = cutoff + 10000.0; m = MothurOut::getInstance(); + if(method == "furthest") { tag = "fn"; } + else if (method == "average") { tag = "an"; } + else if (method == "weighted") { tag = "wn"; } + else if (method == "nearest") { tag = "nn"; } } catch(exception& e) { m->errorOut(e, "ClusterClassic", "ClusterClassic"); @@ -36,7 +40,12 @@ int ClusterClassic::readPhylipFile(string filename, NameAssignment* nameMap) { ifstream fileHandle; m->openInputFile(filename, fileHandle); - fileHandle >> nseqs >> name; + string numTest; + fileHandle >> numTest >> name; + + if (!m->isContainingOnlyDigits(numTest)) { m->mothurOut("[ERROR]: expected a number and got " + numTest + ", quitting."); m->mothurOutEndLine(); exit(1); } + else { convert(numTest, nseqs); } + matrixNames.push_back(name);