X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=shhhercommand.cpp;h=6833f5d4c1cae8f4ee0e3b6f3da3bd2474b31285;hb=83bf613d5a7ffb4dcc75b3cad106d1eed1f9e498;hp=5bf802ef304dde8c9d628db63a9e0915f23f236e;hpb=502a5ed3b2c5798b390ece3595efa3a714ad3f75;p=mothur.git diff --git a/shhhercommand.cpp b/shhhercommand.cpp index 5bf802e..6833f5d 100644 --- a/shhhercommand.cpp +++ b/shhhercommand.cpp @@ -32,7 +32,7 @@ vector ShhherCommand::getValidParameters(){ try { string Array[] = { - "file", "flow", "lookup", "cutoff", "sigma", "outputdir","inputdir", "processors" + "file", "flow", "lookup", "cutoff", "sigma", "outputdir","inputdir", "processors", "maxiter", "mindelta" }; vector myArray (Array, Array+(sizeof(Array)/sizeof(string))); @@ -111,7 +111,7 @@ ShhherCommand::ShhherCommand(string option) { //valid paramters for this command string AlignArray[] = { - "file", "flow", "lookup", "cutoff", "sigma", "outputdir","inputdir", "processors" + "file", "flow", "lookup", "cutoff", "sigma", "outputdir","inputdir", "processors", "maxiter", "mindelta" }; vector myArray (AlignArray, AlignArray+(sizeof(AlignArray)/sizeof(string))); @@ -289,11 +289,13 @@ int ShhherCommand::execute(){ for(int i=0;imothurOut("\n>>>>>\tProcessing " + flowFileName + " (file " + toString(i+1) + " of " + toString(numFiles) + ")\t<<<<<\n"); m->mothurOut("Reading flowgrams...\n"); - getFlowData(); + m->mothurOut("Identifying unique flowgrams...\n"); getUniques(); @@ -702,6 +704,7 @@ int ShhherCommand::execute(){ double begClock = clock(); unsigned long int begTime = time(NULL); + m->mothurOut("\nDenoising flowgrams...\n"); m->mothurOut("iter\tmaxDelta\tnLL\t\tcycletime\n"); @@ -761,6 +764,11 @@ void ShhherCommand::getFlowData(){ m->openInputFile(flowFileName, flowFile); string seqName; + seqNameVector.clear(); + lengths.clear(); + flowDataIntI.clear(); + nameMap.clear(); + int currentNumFlowCells; @@ -943,7 +951,7 @@ void ShhherCommand::getUniques(){ uniqueFlowDataIntI.resize(numFlowCells * numUniques); uniqueLengths.resize(numUniques); - flowDataPrI.assign(numSeqs * numFlowCells, 0); + flowDataPrI.resize(numSeqs * numFlowCells, 0); for(int i=0;imothurOutEndLine(); - m-mothurOut("Total time: " + toString(time(NULL) - begTime) + '\t' + toString((clock() - begClock)/CLOCKS_PER_SEC) + '\n'); + m->mothurOut("Total time: " + toString(time(NULL) - begTime) + '\t' + toString((clock() - begClock)/CLOCKS_PER_SEC) + '\n'); return fDistFileName; @@ -1203,7 +1211,11 @@ void ShhherCommand::getOTUData(string listFileName){ otuData.assign(numSeqs, 0); cumNumSeqs.assign(numOTUs, 0); nSeqsPerOTU.assign(numOTUs, 0); - aaP.resize(numOTUs); + aaP.clear();aaP.resize(numOTUs); + + seqNumber.clear(); + aaI.clear(); + seqIndex.clear(); string singleOTU = ""; @@ -1255,6 +1267,8 @@ void ShhherCommand::getOTUData(string listFileName){ for(int j=nSeqsPerOTU[i];jerrorOut(e, "ShhherCommand", "getOTUData"); @@ -1382,6 +1397,7 @@ void ShhherCommand::calcCentroidsDriver(int start, int finish){ try{ + for(int i=start;i 0 && count > MIN_COUNT){ vector adF(nSeqsPerOTU[i]); vector anL(nSeqsPerOTU[i]); @@ -1673,9 +1689,9 @@ void ShhherCommand::calcNewDistancesChildMPI(int startSeq, int stopSeq, vector newTau(numOTUs,0); vector norms(numSeqs, 0); - otuIndex.resize(0); - seqIndex.resize(0); - singleTau.resize(0); + otuIndex.clear(); + seqIndex.clear(); + singleTau.clear();