]> git.donarmstrong.com Git - mothur.git/blobdiff - readphylipvector.cpp
sffinfo bug with flow grams right index when clipQualRight=0
[mothur.git] / readphylipvector.cpp
index f8907ccb0c88b15a3f8a943d4895b75b18bf8323..85f4777dde02bd4980411d8d48015d2cf06b0e50 100644 (file)
@@ -34,7 +34,11 @@ vector<string> ReadPhylipVector::read(vector< vector<double> >& matrix) {
                int numSeqs;
                string name;
                
-               in >> numSeqs >> name; 
+               string numTest;
+               in >> numTest >> name;
+               
+               if (!m->isContainingOnlyDigits(numTest)) { m->mothurOut("[ERROR]: expected a number and got " + numTest + ". I suspect you entered a column formatted file as a phylip file, quitting."); m->mothurOutEndLine(); exit(1); }
+               else { convert(numTest, numSeqs); }
                
                while((d=in.get()) != EOF){
                        
@@ -94,6 +98,7 @@ vector<string> ReadPhylipVector::read(vector< vector<double> >& matrix) {
                                }
                        }
                }
+               f.close();
                
                return names;
        }
@@ -171,6 +176,7 @@ vector<string> ReadPhylipVector::read(vector<seqDist>& matrix) {
                                }
                        }
                }
+               f.close();
                
                return names;
        }