]> git.donarmstrong.com Git - mothur.git/commitdiff
bugs for 1.5
authorwestcott <westcott>
Mon, 3 Aug 2009 20:08:43 +0000 (20:08 +0000)
committerwestcott <westcott>
Mon, 3 Aug 2009 20:08:43 +0000 (20:08 +0000)
collectsharedcommand.cpp
fileoutput.cpp
mothur.h
parsimonycommand.cpp
parsimonycommand.h
sharedordervector.cpp
sharedrabundvector.cpp

index e158dbb7395b5b7ce643524e24d3ec2f01d58bcc..ae2c52e7c03a9c713930bd77edc22bc402a1b51f 100644 (file)
@@ -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;
                }
                
index 63130a83ba6c850bc8db4ea720ba51a15d80ff81..597a05a6ad9a892caff5f0b6f69269ae6af4013d 100644 (file)
@@ -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<double> 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<string> 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<double> 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<double> 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<double> 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<double> data){
                        }
                        if(counter != 0){               
                                string inputBuffer;
-                               getline(inFile, inputBuffer);
+                               inputBuffer = getline(inFile);
 
                                outFile <<  inputBuffer << setprecision(2) << '\t' << dataOutput << endl;
                        }
index 7d6b1d88f7c74af97bf245056c8a5c74c1774050..5b519bb2111d27259d1969f81e41b805e4a33935 100644 (file)
--- 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;              }
                }
                
index 6df2debe877bc0d594949ad3f62249f3912f76eb..6ffb30b3caf18a695604c69c5556b2b7c5c2b50a 100644 (file)
@@ -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); }
index 63980c254545ea07e7a4ffe71b1d9c496407ecf1..0f12d421ab291e176df2415c70b2ee27365a92ad 100644 (file)
@@ -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();
 
index 76eeafa4b519c02b25c8364e19d3d0397ffdcd96..e1ede6d0e8048ee46cdc38b33ef47b76ffa03624 100644 (file)
@@ -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; }
 
index cb20accf9f93819a45d8492ca9176cd8537b8a0c..142f787e24ac3663c19783874721299a071336cf 100644 (file)
@@ -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; }
                }