]> git.donarmstrong.com Git - mothur.git/commitdiff
fixed problem where order=B was not checking for the maximum homopolymer length
authorPat Schloss <pschloss@umich.edu>
Wed, 17 Jul 2013 18:51:48 +0000 (14:51 -0400)
committerPat Schloss <pschloss@umich.edu>
Wed, 17 Jul 2013 18:51:48 +0000 (14:51 -0400)
flowdata.cpp
flowdata.h
trimflowscommand.cpp

index 66261e33b922f17be93e3f929582ca9ea7d9208f..7d61f8c265e060f2dc0002c94f69edfd054f89ae 100644 (file)
@@ -190,6 +190,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{
index c7fd08a0a0100841e2805062ae5f44f7e5821d6d..cfe349c6e53a14180d521ae6401ed07381c0cd9f 100644 (file)
@@ -24,6 +24,8 @@ public:
        string getName();
        void capFlows(int);
        bool hasMinFlows(int);
+    bool hasGoodHomoP();
+
        Sequence getSequence();
 
        void printFlows(ofstream&);
index aebb16b42a6455693b7c491f83b1740c58acd0e0..2a163516952c27f8a3dc7411536023f69e1f5b08 100644 (file)
@@ -435,7 +435,11 @@ int TrimFlowsCommand::driverCreateTrim(string flowFileName, string trimFlowFileN
                                success = 0;
                                trashCode += 'l';
                        }
-                       
+            if(!flowData.hasGoodHomoP()){      //screen to see if sequence meets the maximum homopolymer limit
+                               success = 0;
+                               trashCode += 'h';
+                       }
+
                        int primerIndex = 0;
                        int barcodeIndex = 0;