X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=makecontigscommand.cpp;h=697521c16abc44dbeee019590f66fb4d03032c64;hb=15b252e317fde72ce0a5de8776cb88112e0ed2b6;hp=431fc42ef9149658a42ebab3e99e52b21265e313;hpb=4c302368ef34f0d897afefc7853edf86fb45b9f3;p=mothur.git diff --git a/makecontigscommand.cpp b/makecontigscommand.cpp index 431fc42..697521c 100644 --- a/makecontigscommand.cpp +++ b/makecontigscommand.cpp @@ -172,9 +172,13 @@ int MakeContigsCommand::execute(){ //read ffastq and rfastq files creating fasta and qual files. //this function will create a forward and reverse, fasta and qual files for each processor. //files has an entry for each processor. files[i][0] = forwardFasta, files[i][1] = forwardQual, files[i][2] = reverseFasta, files[i][3] = reverseQual - vector< vector > files = readFastqFiles(); + int numReads = 0; + m->mothurOut("Reading fastq data..."); cout.flush(); + vector< vector > files = readFastqFiles(numReads); + m->mothurOut("Done.\n"); + string currentFasta = ""; itTypes = outputTypes.find("fasta"); @@ -203,7 +207,7 @@ int MakeContigsCommand::execute(){ } } //********************************************************************************************************************** -vector< vector > MakeContigsCommand::readFastqFiles(){ +vector< vector > MakeContigsCommand::readFastqFiles(int& count){ try { vector< vector > files; @@ -250,7 +254,7 @@ vector< vector > MakeContigsCommand::readFastqFiles(){ ifstream inReverse; m->openInputFile(rfastqfile, inReverse); - int count = 0; + count = 0; while ((!inForward.eof()) && (!inReverse.eof())) { if (m->control_pressed) { for (it = tempfiles.begin(); it!=tempfiles.end(); it++) { for (int i = 0; i < (it->second).size(); i++) { (*(it->second)[i]).close(); delete (it->second)[i]; } } for (int i = 0; i < files.size(); i++) { for(int j = 0; j < files[i].size(); j++) { m->mothurRemove(files[i][j]); } } inForward.close(); inReverse.close(); return files; } @@ -275,7 +279,15 @@ vector< vector > MakeContigsCommand::readFastqFiles(){ *(tempfiles[process][3]) << endl; count++; - } + + //report progress + if((count) % 10000 == 0){ m->mothurOut(toString(count)); m->mothurOutEndLine(); } + + } + //report progress + if((count) % 10000 != 0){ m->mothurOut(toString(count)); m->mothurOutEndLine(); } + + //close files, delete ofstreams for (it = tempfiles.begin(); it!=tempfiles.end(); it++) { for (int i = 0; i < (it->second).size(); i++) { (*(it->second)[i]).close(); delete (it->second)[i]; } }