X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flowdata.cpp;h=5dc7dc3e6c780171f1ee5cacdb1d766864f18a18;hb=4b54ce99af7db8019ea907cd7c2edf789369ada9;hp=1fe7d7faf1e31ee486890980c4731ddebfdca8fb;hpb=90708fe9701e3827e477c82fb3652539c3bf2a0d;p=mothur.git diff --git a/flowdata.cpp b/flowdata.cpp index 1fe7d7f..5dc7dc3 100644 --- a/flowdata.cpp +++ b/flowdata.cpp @@ -42,15 +42,14 @@ FlowData::FlowData(int numFlows, float signal, float noise, int maxHomoP, string bool FlowData::getNext(ifstream& flowFile){ try { - flowFile >> seqName >> endFlow; - if (seqName.length() != 0) { - //cout << "in Flowdata " + seqName << endl; + seqName = getSequenceName(flowFile); + flowFile >> endFlow; + if (!m->control_pressed) { for(int i=0;i> flowData[i]; } - //cout << "in Flowdata read " << seqName + " done" << endl; updateEndFlow(); translateFlow(); m->gobble(flowFile); - }else{ m->mothurOut("Error in reading your flowfile, at position " + toString(flowFile.tellg()) + ". Blank name."); m->mothurOutEndLine(); } + } if(flowFile){ return 1; } else { return 0; } @@ -61,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); + } +} //**********************************************************************************************************************