From ce8794490ab1d83adcdb2b92e0302a1e43e17adf Mon Sep 17 00:00:00 2001 From: Sarah Westcott Date: Tue, 10 Jul 2012 11:17:33 -0400 Subject: [PATCH] changes while testing 1.26 --- chimeracheckcommand.cpp | 1 + counttable.cpp | 3 ++- makecontigscommand.h | 2 +- matrixoutputcommand.cpp | 2 +- mgclustercommand.cpp | 6 ------ otuhierarchycommand.cpp | 2 +- seqerrorcommand.cpp | 4 ++-- sequenceparser.cpp | 5 +++-- sharedlistvector.cpp | 1 + sharedrabundfloatvector.cpp | 2 +- summarysharedcommand.cpp | 4 ++-- 11 files changed, 15 insertions(+), 17 deletions(-) diff --git a/chimeracheckcommand.cpp b/chimeracheckcommand.cpp index 87f51e7..6a4732c 100644 --- a/chimeracheckcommand.cpp +++ b/chimeracheckcommand.cpp @@ -551,6 +551,7 @@ int ChimeraCheckCommand::driver(linePair* filePos, string outputFName, string fi //report progress if((count) % 100 == 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine(); } + count++; } //report progress if((count) % 100 != 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine(); } diff --git a/counttable.cpp b/counttable.cpp index 7f08509..f632731 100644 --- a/counttable.cpp +++ b/counttable.cpp @@ -42,7 +42,8 @@ int CountTable::readTable(string file) { if (m->control_pressed) { break; } - in >> name >> thisTotal; m->gobble(in); + in >> name; m->gobble(in); in >> thisTotal; m->gobble(in); + if (m->debug) { m->mothurOut("[DEBUG]: " + name + '\t' + toString(thisTotal) + "\n"); } //if group info, then read it vector groupCounts; groupCounts.resize(numGroups, 0); diff --git a/makecontigscommand.h b/makecontigscommand.h index dc094a2..2308b65 100644 --- a/makecontigscommand.h +++ b/makecontigscommand.h @@ -168,7 +168,7 @@ static DWORD WINAPI MyContigsThreadFunction(LPVOID lpParam){ contigScores.push_back(scores1[ABaseMap[i]]); if (scores1[ABaseMap[i]] < scores2[BBaseMap[i]]) { contigScores[i] = scores2[BBaseMap[i]]; } }else if (((seq1[i] == '.') || (seq1[i] == '-')) && ((seq2[i] != '-') && (seq2[i] != '.'))) { //seq1 is a gap and seq2 is a base, choose seq2, unless quality score for base is below threshold. In that case eliminate base - if (scores2[BBaseMap[i]] >= pDataArray->threshold)) { + if (scores2[BBaseMap[i]] >= pDataArray->threshold) { contig += seq2[i]; contigScores.push_back(scores2[BBaseMap[i]]); } diff --git a/matrixoutputcommand.cpp b/matrixoutputcommand.cpp index 4b92c57..a886992 100644 --- a/matrixoutputcommand.cpp +++ b/matrixoutputcommand.cpp @@ -467,7 +467,7 @@ void MatrixOutputCommand::printSims(ostream& out, vector< vector >& simM out << endl; } }else{ - for (int b = 0; b < simMatrix.size(); m++) { + for (int b = 0; b < simMatrix.size(); b++) { out << lookup[b]->getGroup() << '\t'; for (int n = 0; n < simMatrix[b].size(); n++) { out << simMatrix[b][n] << '\t'; diff --git a/mgclustercommand.cpp b/mgclustercommand.cpp index 4ca0cdf..2143495 100644 --- a/mgclustercommand.cpp +++ b/mgclustercommand.cpp @@ -716,12 +716,6 @@ void MGClusterCommand::sortHclusterFiles(string unsortedDist, string unsortedOve void MGClusterCommand::createRabund(map nameMapCounts){ try { - //RAbundVector rav; - map::iterator it; - //it = nameMapCounts.begin(); - //for(int i = 0; i < list->getNumBins(); i++) { rav.push_back((*it).second); it++; } - for ( it=nameMapCounts.begin(); it!=nameMapCounts.end(); it++ ) { rav.push_back( it->second ); } - //return rav; } catch(exception& e) { m->errorOut(e, "MGClusterCommand", "createRabund"); diff --git a/otuhierarchycommand.cpp b/otuhierarchycommand.cpp index 3898796..e32e0b6 100644 --- a/otuhierarchycommand.cpp +++ b/otuhierarchycommand.cpp @@ -199,7 +199,7 @@ int OtuHierarchyCommand::execute(){ } ofstream out; - string outputFileName = outputDir + m->getRootName(m->getSimpleName(listFile)) + lists[0].getLabel() + "-" + lists[1].getLabel() + "." + getOutputFileNameTag("otuhierarchy"); + string outputFileName = outputDir + m->getRootName(m->getSimpleName(listFile)) + lists[0].getLabel() + "-" + lists[1].getLabel() + "." + getOutputFileNameTag("otuheirarchy"); m->openOutputFile(outputFileName, out); //go through each bin in "big" otu and output the bins in "little" otu which created it diff --git a/seqerrorcommand.cpp b/seqerrorcommand.cpp index 8fd6368..9a7b814 100644 --- a/seqerrorcommand.cpp +++ b/seqerrorcommand.cpp @@ -782,7 +782,7 @@ int SeqErrorCommand::driver(string filename, string qFileName, string rFileName, if (queryFile.eof()) { break; } #endif - if(index % 100 == 0){ m->mothurOut(toString(index) + '\n'); } + if(index % 100 == 0){ m->mothurOut(toString(index)); m->mothurOutEndLine(); } } queryFile.close(); if(qFileName != "" && rFileName != ""){ reportFile.close(); qualFile.close(); } @@ -790,7 +790,7 @@ int SeqErrorCommand::driver(string filename, string qFileName, string rFileName, errorSeqFile.close(); //report progress - if(index % 100 != 0){ m->mothurOut(toString(index) + '\n'); } + if(index % 100 != 0){ m->mothurOut(toString(index)); m->mothurOutEndLine(); } return index; } diff --git a/sequenceparser.cpp b/sequenceparser.cpp index c45602e..08e5ae8 100644 --- a/sequenceparser.cpp +++ b/sequenceparser.cpp @@ -64,7 +64,7 @@ SequenceParser::SequenceParser(string groupFile, string fastaFile, string nameFi ifstream inName; m->openInputFile(nameFile, inName); - string first, second; + //string first, second; int countName = 0; set thisnames1; @@ -85,8 +85,9 @@ SequenceParser::SequenceParser(string groupFile, string fastaFile, string nameFi else { secondCol = pieces[i]; pairDone = true; columnOne=true; } if (pairDone) { //save one line + if (m->debug) { m->mothurOut("[DEBUG]: reading names: " + firstCol + '\t' + secondCol + ".\n"); } vector names; - m->splitAtChar(second, names, ','); + m->splitAtChar(secondCol, names, ','); //get aligned string for these seqs from the fasta file string alignedString = ""; diff --git a/sharedlistvector.cpp b/sharedlistvector.cpp index 2cecb5d..223ca07 100644 --- a/sharedlistvector.cpp +++ b/sharedlistvector.cpp @@ -25,6 +25,7 @@ SharedListVector::SharedListVector(int n): DataVector(), data(n, "") , maxRank(0 /***********************************************************************/ SharedListVector::SharedListVector(ifstream& f) : DataVector(), maxRank(0), numBins(0), numSeqs(0) { try { + groupmap = NULL; countTable = NULL; //set up groupmap for later. if (m->groupMode == "group") { groupmap = new GroupMap(m->getGroupFile()); diff --git a/sharedrabundfloatvector.cpp b/sharedrabundfloatvector.cpp index b6d916a..b8b9102 100644 --- a/sharedrabundfloatvector.cpp +++ b/sharedrabundfloatvector.cpp @@ -129,7 +129,6 @@ SharedRAbundFloatVector::SharedRAbundFloatVector(ifstream& f) : DataVector(), ma while ((nextLabel == holdLabel) && (f.eof() != true)) { f >> groupN >> num; - if (num != 1000) { break; } count++; allGroups.push_back(groupN); @@ -153,6 +152,7 @@ SharedRAbundFloatVector::SharedRAbundFloatVector(ifstream& f) : DataVector(), ma m->saveNextLabel = nextLabel; m->setAllGroups(allGroups); + for (int i = 0; i < allGroups.size(); i++) { cout << allGroups[i] << endl; } } catch(exception& e) { diff --git a/summarysharedcommand.cpp b/summarysharedcommand.cpp index 50fbd32..6147832 100644 --- a/summarysharedcommand.cpp +++ b/summarysharedcommand.cpp @@ -74,7 +74,7 @@ string SummarySharedCommand::getOutputFileNameTag(string type, string inputName= if (it == outputTypes.end()) { m->mothurOut("[ERROR]: this command doesn't create a " + type + " output file.\n"); } else { if (type == "summary") { outputFileName = "shared.summary"; } - if (type == "phylip") { outputFileName = "dist"; } + else if (type == "phylip") { outputFileName = "dist"; } else { m->mothurOut("[ERROR]: No definition for type " + type + " output file tag.\n"); m->control_pressed = true; } } return outputFileName; @@ -879,7 +879,7 @@ int SummarySharedCommand::process(vector thisLookup, string stdmatrix[column][row] = stdDist; } - string distFileName = outputDir + m->getRootName(m->getSimpleName(sharedfile)) + sumCalculators[i]->getName() + "." + thisLookup[0]->getLabel() + "." + output + ".ave." + getOutputFileNameTag("phylip");; + string distFileName = outputDir + m->getRootName(m->getSimpleName(sharedfile)) + sumCalculators[i]->getName() + "." + thisLookup[0]->getLabel() + "." + output + ".ave." + getOutputFileNameTag("phylip"); outputNames.push_back(distFileName); outputTypes["phylip"].push_back(distFileName); ofstream outAve; m->openOutputFile(distFileName, outAve); -- 2.39.2