From e9a9b24f05e69ab94bf89a423f782e6a50462bba Mon Sep 17 00:00:00 2001 From: Pat Schloss Date: Wed, 17 Jul 2013 14:51:48 -0400 Subject: [PATCH] fixed problem where order=B was not checking for the maximum homopolymer length --- flowdata.cpp | 21 +++++++++++++++++++++ flowdata.h | 2 ++ trimflowscommand.cpp | 6 +++++- 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/flowdata.cpp b/flowdata.cpp index 66261e3..7d61f8c 100644 --- a/flowdata.cpp +++ b/flowdata.cpp @@ -190,6 +190,27 @@ void FlowData::capFlows(int mF){ //********************************************************************************************************************** +bool FlowData::hasGoodHomoP(){ + + try{ + + float maxIntensity = (float) maxHomoP + 0.49; + + for(int i=0;i maxIntensity){ + return 0; + } + } + return 1; + } + catch(exception& e) { + m->errorOut(e, "FlowData", "hasMinFlows"); + exit(1); + } +} + +//********************************************************************************************************************** + bool FlowData::hasMinFlows(int minFlows){ try{ diff --git a/flowdata.h b/flowdata.h index c7fd08a..cfe349c 100644 --- a/flowdata.h +++ b/flowdata.h @@ -24,6 +24,8 @@ public: string getName(); void capFlows(int); bool hasMinFlows(int); + bool hasGoodHomoP(); + Sequence getSequence(); void printFlows(ofstream&); diff --git a/trimflowscommand.cpp b/trimflowscommand.cpp index aebb16b..2a16351 100644 --- a/trimflowscommand.cpp +++ b/trimflowscommand.cpp @@ -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; -- 2.39.2