]> git.donarmstrong.com Git - mothur.git/blobdiff - readphylip.cpp
fixing bugs while testing
[mothur.git] / readphylip.cpp
index b13dc25c0eded92a950bfc41a782075624e47fdd..1c529b26f15fdfa172c8a0f7ebcf20187e87b03b 100644 (file)
@@ -36,9 +36,13 @@ int ReadPhylipMatrix::read(NameAssignment* nameMap){
                         int square, nseqs;
                         string name;
                         vector<string> matrixNames;
-        
-                        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);
 
                         if(nameMap == NULL){