]> git.donarmstrong.com Git - mothur.git/blobdiff - mothur.h
added groups option to get.oturep command
[mothur.git] / mothur.h
index 5d12977383c4d2eb0457cc88190f078a98a5755e..2404a84f08672c2178bd3e0a33946124348a72a7 100644 (file)
--- a/mothur.h
+++ b/mothur.h
@@ -577,7 +577,7 @@ inline int openInputFile(string fileName, ifstream& fileHandle){
        else {
                //check for blank file
                gobble(fileHandle);
-               if (fileHandle.eof()) { cout << completeFileName << " is blank. Please correct." << endl;  return 1;  }
+               if (fileHandle.eof()) { cout << completeFileName << " is blank. Please correct." << endl;   }
                
                return 0;
        }
@@ -632,6 +632,19 @@ inline int getNumSeqs(ifstream& file){
        return numSeqs;
 
 }
+/***********************************************************************/
+inline void getNumSeqs(ifstream& file, int& numSeqs){
+       
+       string input;
+       numSeqs = 0;
+       while(!file.eof()){
+               input = getline(file);
+               if (input.length() != 0) {
+                       if(input[0] == '>'){ numSeqs++; }
+               }
+       }
+}
+
 /***********************************************************************/
 
 inline bool inVector(string member, vector<string> group){
@@ -815,7 +828,13 @@ inline bool anyLabelsToProcess(string label, set<string>& userLabels, string err
                
                //unique is the smallest line
                if (label == "unique") {  return false;  }
-               else { convert(label, labelFloat); }
+               else { 
+                       if (convertTestFloat(label, labelFloat)) {
+                               convert(label, labelFloat); 
+                       }else { //cant convert 
+                               return false;
+                       }
+               }
                
                //go through users set and make them floats
                for(it = userLabels.begin(); it != userLabels.end(); ++it) {