From: westcott Date: Mon, 3 Aug 2009 20:08:43 +0000 (+0000) Subject: bugs for 1.5 X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=commitdiff_plain;h=5a9f3cce3e2e053c249e3e97507ce180f0854d76 bugs for 1.5 --- diff --git a/collectsharedcommand.cpp b/collectsharedcommand.cpp index e158dbb..ae2c52e 100644 --- a/collectsharedcommand.cpp +++ b/collectsharedcommand.cpp @@ -251,7 +251,7 @@ int CollectSharedCommand::execute(){ cCurve->getSharedCurve(freq); delete cCurve; - mothurOut(order->getLabel() + "\t" + toString(count)); mothurOutEndLine(); + mothurOut(order->getLabel()); mothurOutEndLine(); processedLabels.insert(order->getLabel()); userLabels.erase(order->getLabel()); userLines.erase(count); @@ -267,7 +267,7 @@ int CollectSharedCommand::execute(){ cCurve->getSharedCurve(freq); delete cCurve; - mothurOut(order->getLabel() + "\t" + toString(count)); mothurOutEndLine(); + mothurOut(order->getLabel()); mothurOutEndLine(); processedLabels.insert(order->getLabel()); userLabels.erase(order->getLabel()); } @@ -303,7 +303,7 @@ int CollectSharedCommand::execute(){ cCurve->getCurve(freq); delete cCurve; - mothurOut(order->getLabel() + "\t" + toString(count)); mothurOutEndLine(); + mothurOut(order->getLabel()); mothurOutEndLine(); delete order; } diff --git a/fileoutput.cpp b/fileoutput.cpp index 63130a8..597a05a 100644 --- a/fileoutput.cpp +++ b/fileoutput.cpp @@ -27,7 +27,7 @@ void ThreeColumnFile::initFile(string label){ openInputFile(inName, inFile); string inputBuffer; - getline(inFile, inputBuffer); + inputBuffer = getline(inFile); outFile << inputBuffer << '\t' << label << "\tlci\thci" << endl; } @@ -51,7 +51,7 @@ void ThreeColumnFile::output(int nSeqs, vector data){ try { if(counter != 0){ string inputBuffer; - getline(inFile, inputBuffer); + inputBuffer = getline(inFile); outFile << inputBuffer << setprecision(4) << '\t' << data[0] << '\t' << data[1] << '\t' << data[2] << endl; } @@ -110,7 +110,7 @@ void ColumnFile::initFile(string label, vector tags){ openInputFile(inName, inFile); string inputBuffer; - getline(inFile, inputBuffer); + inputBuffer = getline(inFile); outFile << inputBuffer << '\t'; for(int i = 0; i < tags.size(); i++) { @@ -142,7 +142,7 @@ void ColumnFile::output(vector data){ if(counter != 0){ string inputBuffer; - getline(inFile, inputBuffer); + inputBuffer = getline(inFile); outFile << inputBuffer << '\t' << setprecision(6) << data[0] << setprecision(iters.length()); for (int i = 1; i< data.size(); i++) { @@ -210,7 +210,7 @@ void SharedThreeColumnFile::initFile(string label){ openInputFile(inName, inFile); string inputBuffer; - getline(inFile, inputBuffer); + inputBuffer = getline(inFile); outFile << inputBuffer << '\t' << label << "\tlci\thci" << endl; } @@ -234,7 +234,7 @@ void SharedThreeColumnFile::output(int nSeqs, vector data){ try { if(counter != 0){ string inputBuffer; - getline(inFile, inputBuffer); + inputBuffer = getline(inFile); outFile << inputBuffer << setprecision(4) << '\t' << data[0] << '\t' << data[1] << '\t' << data[2] << endl; } @@ -294,7 +294,7 @@ void OneColumnFile::initFile(string label){ openInputFile(inName, inFile); string inputBuffer; - getline(inFile, inputBuffer); + inputBuffer = getline(inFile); outFile << inputBuffer << '\t' << label << endl; } @@ -318,7 +318,7 @@ void OneColumnFile::output(int nSeqs, vector data){ try { if(counter != 0){ string inputBuffer; - getline(inFile, inputBuffer); + inputBuffer = getline(inFile); outFile << inputBuffer << setprecision(4) << '\t' << data[0] << endl; } @@ -376,7 +376,7 @@ void SharedOneColumnFile::initFile(string label){ openInputFile(inName, inFile); string inputBuffer; - getline(inFile, inputBuffer); + inputBuffer = getline(inFile); outFile << inputBuffer << '\t' << label << endl; @@ -409,7 +409,7 @@ void SharedOneColumnFile::output(int nSeqs, vector data){ } if(counter != 0){ string inputBuffer; - getline(inFile, inputBuffer); + inputBuffer = getline(inFile); outFile << inputBuffer << setprecision(2) << '\t' << dataOutput << endl; } diff --git a/mothur.h b/mothur.h index 7d6b1d8..5b519bb 100644 --- a/mothur.h +++ b/mothur.h @@ -180,7 +180,7 @@ inline string getline(ifstream& fileHandle) { char c = fileHandle.get(); //are you at the end of the line - if (c == 10 || c == 13){ break; } + if ((c == '\n') || (c == '\r') || (c == '\f')){ break; } else { line += c; } } diff --git a/parsimonycommand.cpp b/parsimonycommand.cpp index 6df2deb..6ffb30b 100644 --- a/parsimonycommand.cpp +++ b/parsimonycommand.cpp @@ -45,7 +45,7 @@ ParsimonyCommand::ParsimonyCommand(string option) { //check for optional parameter and set defaults // ...at some point should added some additional type checking... groups = validParameter.validFile(parameters, "groups", false); - if (groups == "not found") { groups = ""; } + if (groups == "not found") { groups = ""; globaldata->Groups.clear(); } else { splitAtDash(groups, Groups); globaldata->Groups = Groups; @@ -71,7 +71,7 @@ ParsimonyCommand::ParsimonyCommand(string option) { //set users groups to analyze util = new SharedUtil(); - util->setGroups(globaldata->Groups, tmap->namesOfGroups, allGroups, numGroups, "unweighted"); //sets the groups the user wants to analyze + util->setGroups(globaldata->Groups, tmap->namesOfGroups, allGroups, numGroups, "parsimony"); //sets the groups the user wants to analyze util->getCombos(groupComb, globaldata->Groups, numComp); if (numGroups == 1) { numComp++; groupComb.push_back(allGroups); } diff --git a/parsimonycommand.h b/parsimonycommand.h index 63980c2..0f12d42 100644 --- a/parsimonycommand.h +++ b/parsimonycommand.h @@ -23,7 +23,7 @@ class ParsimonyCommand : public Command { public: ParsimonyCommand(string); - ~ParsimonyCommand() { delete pars; delete util; delete output; } + ~ParsimonyCommand() { if (abort == false) { delete pars; delete util; delete output; } } int execute(); void help(); diff --git a/sharedordervector.cpp b/sharedordervector.cpp index 76eeafa..e1ede6d 100644 --- a/sharedordervector.cpp +++ b/sharedordervector.cpp @@ -57,6 +57,8 @@ SharedOrderVector::SharedOrderVector(ifstream& f) : DataVector() { //reads in a } } + gobble(f); + if (f.eof() != true) { f >> nextLabel; } //read the rest of the groups info in @@ -79,6 +81,7 @@ SharedOrderVector::SharedOrderVector(ifstream& f) : DataVector() { //reads in a } } + gobble(f); if (f.eof() != true) { f >> nextLabel; } diff --git a/sharedrabundvector.cpp b/sharedrabundvector.cpp index cb20acc..142f787 100644 --- a/sharedrabundvector.cpp +++ b/sharedrabundvector.cpp @@ -101,6 +101,8 @@ SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0), } + gobble(f); + if (f.eof() != true) { f >> nextLabel; } //read the rest of the groups info in @@ -126,6 +128,7 @@ SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0), lookup[count]->push_back(inputData, i, groupN); //abundance, bin, group } + gobble(f); if (f.eof() != true) { f >> nextLabel; } }