]> git.donarmstrong.com Git - mothur.git/blobdiff - flowdata.cpp
added ':' name check to seq. error and fastq.info. sffinfo now ignores clipQualRight...
[mothur.git] / flowdata.cpp
index 1420f84b992a54ed6dfb6d3a28d8452a083691de..5dc7dc3e6c780171f1ee5cacdb1d766864f18a18 100644 (file)
@@ -42,14 +42,15 @@ FlowData::FlowData(int numFlows, float signal, float noise, int maxHomoP, string
 bool FlowData::getNext(ifstream& flowFile){
        
        try {
-               flowFile >> seqName >> endFlow; 
-               //cout << "in Flowdata " + seqName << endl;
-               for(int i=0;i<numFlows;i++)     {       flowFile >> flowData[i];        }
-               //cout << "in Flowdata read " << seqName + " done" << endl;
-               updateEndFlow(); 
-               translateFlow();
-               
-               m->gobble(flowFile);
+        seqName = getSequenceName(flowFile);
+               flowFile >> endFlow;    
+        if (!m->control_pressed) {
+            for(int i=0;i<numFlows;i++)        {       flowFile >> flowData[i];        }
+            updateEndFlow(); 
+            translateFlow();
+            m->gobble(flowFile);
+               }
+            
                if(flowFile){   return 1;       }
                else            {       return 0;       }
        }
@@ -59,6 +60,26 @@ bool FlowData::getNext(ifstream& flowFile){
        }
        
 }
+//********************************************************************************************************************
+string FlowData::getSequenceName(ifstream& flowFile) {
+       try {
+               string name = "";
+               
+        flowFile >> name;
+               
+               if (name.length() != 0) { 
+            for (int i = 0; i < name.length(); i++) {
+                if (name[i] == ':') { name[i] = '_'; m->changedSeqNames = true; }
+            }
+        }else{ m->mothurOut("Error in reading your flowfile, at position " + toString(flowFile.tellg()) + ". Blank name."); m->mothurOutEndLine(); m->control_pressed = true;  }
+        
+               return name;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "FlowData", "getSequenceName");
+               exit(1);
+       }
+}
 
 //**********************************************************************************************************************