]> git.donarmstrong.com Git - mothur.git/blobdiff - clusterclassic.cpp
added check to cluster.classic to make sure file type is phylip. added mapping funct...
[mothur.git] / clusterclassic.cpp
index f0bae59ab33de8c2f451b80c7180a33c49c28a54..2d1b9a6b781960a824fddafc03b904e8039179e1 100644 (file)
@@ -40,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);