X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=seqsummarycommand.cpp;h=6d8336cb40217a9547791e69765230dff0dabe62;hp=8f27b8c7beaf797775f680bdef5c34bcf7f980c8;hb=c48d91112209b841444923670dca5454da0e2a4d;hpb=1a5c2356c1b955c6ec024b2baf9f46377ee7c72e diff --git a/seqsummarycommand.cpp b/seqsummarycommand.cpp index 8f27b8c..6d8336c 100644 --- a/seqsummarycommand.cpp +++ b/seqsummarycommand.cpp @@ -415,6 +415,13 @@ int SeqSummaryCommand::execute(){ } #endif + //set fasta file as new current fastafile + string current = ""; + itTypes = outputTypes.find("summary"); + if (itTypes != outputTypes.end()) { + if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setSummaryFile(current); } + } + return 0; } catch(exception& e) { @@ -445,11 +452,15 @@ int SeqSummaryCommand::driverCreateSummary(vector& startPosition, vectorcontrol_pressed) { in.close(); outSummary.close(); return 1; } - + + if (m->debug) { m->mothurOut("[DEBUG]: count = " + toString(count) + "\n"); } + Sequence current(in); m->gobble(in); if (current.getName() != "") { + if (m->debug) { m->mothurOut("[DEBUG]: " + current.getName() + '\t' + toString(current.getNumBases()) + "\n"); } + int num = 1; if ((namefile != "") || (countfile != "")) { //make sure this sequence is in the namefile, else error @@ -473,6 +484,8 @@ int SeqSummaryCommand::driverCreateSummary(vector& startPosition, vectordebug) { m->mothurOut("[DEBUG]: " + current.getName() + '\t' + toString(current.getNumBases()) + "\n"); } } #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix) @@ -481,13 +494,8 @@ int SeqSummaryCommand::driverCreateSummary(vector& startPosition, vectormothurOut(toString(count)); m->mothurOutEndLine(); } } - //report progress - //if((count) % 100 != 0){ m->mothurOut(toString(count)); m->mothurOutEndLine(); } - + in.close(); return count; @@ -675,6 +683,9 @@ int SeqSummaryCommand::createProcessesCreateSummary(vector& startPosition, //Close all thread handles and free memory allocations. for(int i=0; i < pDataArray.size(); i++){ num += pDataArray[i]->count; + if (pDataArray[i]->count != pDataArray[i]->end) { + m->mothurOut("[ERROR]: process " + toString(i) + " only processed " + toString(pDataArray[i]->count) + " of " + toString(pDataArray[i]->end) + " sequences assigned to it, quitting. \n"); m->control_pressed = true; + } for (int k = 0; k < pDataArray[i]->startPosition.size(); k++) { startPosition.push_back(pDataArray[i]->startPosition[k]); } for (int k = 0; k < pDataArray[i]->endPosition.size(); k++) { endPosition.push_back(pDataArray[i]->endPosition[k]); } for (int k = 0; k < pDataArray[i]->seqLength.size(); k++) { seqLength.push_back(pDataArray[i]->seqLength[k]); }