X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flowdata.cpp;h=2891281c9de412a27b2d27229683c8d3bb7cf41b;hb=250e3b11b1c9c1e1ad458ab6c7e71ac2e67e11d9;hp=d5adcf7163a14c27c4c783efd05359aa1494e1a7;hpb=08ab48641e3c75cc341971a374f771ad860f6f2b;p=mothur.git diff --git a/flowdata.cpp b/flowdata.cpp index d5adcf7..2891281 100644 --- a/flowdata.cpp +++ b/flowdata.cpp @@ -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> flowData[i]; } + if (m->debug) { m->mothurOut(" "); } + for(int i=0;i> flowData[i]; + if (m->debug) { m->mothurOut(toString(flowData[i]) + " "); } + } + if (m->debug) { m->mothurOut("\n"); } updateEndFlow(); translateFlow(); m->gobble(flowFile); @@ -68,9 +75,7 @@ string FlowData::getSequenceName(ifstream& flowFile) { flowFile >> name; if (name.length() != 0) { - for (int i = 0; i < name.length(); i++) { - if (name[i] == ':') { name[i] = '_'; m->changedSeqNames = true; } - } + m->checkName(name); }else{ m->mothurOut("Error in reading your flowfile, at position " + toString(flowFile.tellg()) + ". Blank name."); m->mothurOutEndLine(); m->control_pressed = true; } return name; @@ -86,7 +91,7 @@ string FlowData::getSequenceName(ifstream& flowFile) { void FlowData::updateEndFlow(){ try{ - //if (baseFlow.length() > 4) { return; } + if (baseFlow.length() > 4) { return; } //int currLength = 0; float maxIntensity = (float) maxHomoP + 0.49; @@ -192,6 +197,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{