]> git.donarmstrong.com Git - mothur.git/blobdiff - flowdata.cpp
fixes while testing 1.33.0
[mothur.git] / flowdata.cpp
index 66261e33b922f17be93e3f929582ca9ea7d9208f..2891281c9de412a27b2d27229683c8d3bb7cf41b 100644 (file)
@@ -40,12 +40,19 @@ FlowData::FlowData(int numFlows, float signal, float noise, int maxHomoP, string
 //**********************************************************************************************************************
 
 bool FlowData::getNext(ifstream& flowFile){
-       
        try {
+        
         seqName = getSequenceName(flowFile);
-               flowFile >> endFlow;    
+        if (m->debug) {  m->mothurOut("[DEBUG]: flow = " + seqName + " "); }
+               flowFile >> endFlow;
+        if (m->debug) {  m->mothurOut(toString(endFlow) + " "); }
         if (!m->control_pressed) {
-            for(int i=0;i<numFlows;i++)        {       flowFile >> flowData[i];        }
+            if (m->debug) {  m->mothurOut(" "); }
+            for(int i=0;i<numFlows;i++)        {
+                flowFile >> flowData[i];
+                if (m->debug) {  m->mothurOut(toString(flowData[i]) + " "); }
+            }
+            if (m->debug) {  m->mothurOut("\n"); }
             updateEndFlow(); 
             translateFlow();
             m->gobble(flowFile);
@@ -190,6 +197,27 @@ void FlowData::capFlows(int mF){
 
 //**********************************************************************************************************************
 
+bool FlowData::hasGoodHomoP(){
+       
+       try{
+        
+        float maxIntensity = (float) maxHomoP + 0.49;
+
+        for(int i=0;i<endFlow;i++){
+            if(flowData[i] > maxIntensity){
+                return 0;
+            }
+        }
+               return 1;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "FlowData", "hasMinFlows");
+               exit(1);
+       }
+}
+
+//**********************************************************************************************************************
+
 bool FlowData::hasMinFlows(int minFlows){
        
        try{