X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=shhhercommand.cpp;h=7fa99f1b04fd2632bf4d6e59ab08db6d1a38c1d9;hp=4a6e5ff2375ce40560db1aa706edbdacefac0e0d;hb=cf9987b67aa49777a4c91c2d21f96e58bf17aa82;hpb=4283eb0248ca6e7e3e3344647f16166da0e14147 diff --git a/shhhercommand.cpp b/shhhercommand.cpp index 4a6e5ff..7fa99f1 100644 --- a/shhhercommand.cpp +++ b/shhhercommand.cpp @@ -1414,7 +1414,8 @@ string ShhherCommand::cluster(string distFileName, string namesFileName){ RAbundVector* rabund = new RAbundVector(list->getRAbundVector()); - Cluster* cluster = new CompleteLinkage(rabund, list, matrix, cutoff, "furthest"); + float adjust = -1.0; + Cluster* cluster = new CompleteLinkage(rabund, list, matrix, cutoff, "furthest", adjust); string tag = cluster->getTag(); double clusterCutoff = cutoff; @@ -1690,10 +1691,8 @@ void ShhherCommand::writeQualities(vector otuCounts){ if (m->control_pressed) { break; } int index = 0; - int base = 0; if(nSeqsPerOTU[i] > 0){ - qualities[i].assign(1024, -1); while(index < numFlowCells){ double maxPrValue = 1e8; @@ -1742,8 +1741,7 @@ void ShhherCommand::writeQualities(vector otuCounts){ value = (int)floor(temp); if(value > 100){ value = 100; } - qualities[i][base] = (int)value; - base++; + qualities[i].push_back((int)value); } } @@ -1754,12 +1752,7 @@ void ShhherCommand::writeQualities(vector otuCounts){ if(otuCounts[i] > 0){ qualityFile << '>' << seqNameVector[mapUniqueToSeq[i]] << endl; - - int j=4; //need to get past the first four bases - while(qualities[i][j] != -1){ - qualityFile << qualities[i][j] << ' '; - j++; - } + for (int j = 4; j < qualities[i].size(); j++) { qualityFile << qualities[i][j] << ' '; } qualityFile << endl; } } @@ -2394,16 +2387,22 @@ int ShhherCommand::driver(vector filenames, string thisCompositeFASTAFil m->mothurOut("\nFinalizing...\n"); fill(numOTUs, seqNumber, seqIndex, cumNumSeqs, nSeqsPerOTU, aaP, aaI); + if (m->debug) { m->mothurOut("[DEBUG]: done fill().\n"); } + if (m->control_pressed) { break; } setOTUs(numOTUs, numSeqs, seqNumber, seqIndex, cumNumSeqs, nSeqsPerOTU, otuData, singleTau, dist, aaP, aaI); + if (m->debug) { m->mothurOut("[DEBUG]: done setOTUs().\n"); } + if (m->control_pressed) { break; } vector otuCounts(numOTUs, 0); for(int j=0;jdebug) { m->mothurOut("[DEBUG]: done calcCentroidsDriver().\n"); } if (m->control_pressed) { break; } @@ -3280,12 +3279,11 @@ void ShhherCommand::writeQualities(int numOTUs, int numFlowCells, string quality if (m->control_pressed) { break; } int index = 0; - int base = 0; - + if(nSeqsPerOTU[i] > 0){ - qualities[i].assign(1024, -1); while(index < numFlowCells){ + double maxPrValue = 1e8; short maxPrIndex = -1; double count = 0.0000; @@ -3304,7 +3302,7 @@ void ShhherCommand::writeQualities(int numOTUs, int numFlowCells, string quality pr[s] += tauValue * singleLookUp[s * NUMBINS + intensity]; } } - + maxPrIndex = uniqueFlowgrams[centroids[i] * numFlowCells + index]; maxPrValue = pr[maxPrIndex]; @@ -3315,7 +3313,7 @@ void ShhherCommand::writeQualities(int numOTUs, int numFlowCells, string quality for(int s=0;s 100){ value = 100; } - qualities[i][base] = (int)value; - base++; + qualities[i].push_back((int)value); } - } + }//end if index++; - } - } - + + }//end while + + }//end if + if(otuCounts[i] > 0){ qualityFile << '>' << seqNameVector[mapUniqueToSeq[i]] << endl; - - int j=4; //need to get past the first four bases - while(qualities[i][j] != -1){ - qualityFile << qualities[i][j] << ' '; - if (j > qualities[i].size()) { break; } - j++; - } + //need to get past the first four bases + for (int j = 4; j < qualities[i].size(); j++) { qualityFile << qualities[i][j] << ' '; } qualityFile << endl; } - } + }//end for qualityFile.close(); outputNames.push_back(qualityFileName); outputTypes["qfile"].push_back(qualityFileName);