]> git.donarmstrong.com Git - mothur.git/commitdiff
bugs fixes while testing for 1.5 release
authorwestcott <westcott>
Wed, 5 Aug 2009 18:32:19 +0000 (18:32 +0000)
committerwestcott <westcott>
Wed, 5 Aug 2009 18:32:19 +0000 (18:32 +0000)
25 files changed:
binsequencecommand.cpp
binsequencecommand.h
bootstrapsharedcommand.cpp
chao1.cpp
collectcommand.cpp
collectdisplay.h
collectorscurvedata.h
display.h
fileoutput.cpp
getoturepcommand.cpp
getrabundcommand.cpp
getsabundcommand.cpp
heatmapcommand.cpp
heatmapsimcommand.cpp
matrixoutputcommand.cpp
mothur.h
rarefactcommand.cpp
rarefactsharedcommand.cpp
sharedchao1.cpp
sharedcommand.cpp
summarycommand.cpp
summarysharedcommand.cpp
tree.cpp
treegroupscommand.cpp
venncommand.cpp

index 88057379be6f400e656b73f5a9c85d4f52a32a22..e1f98eb94a02b6ef39073270e5c0d09f55e69025 100644 (file)
@@ -170,7 +170,7 @@ int BinSeqCommand::execute(){
                        
                        if(allLines == 1 || lines.count(count) == 1 || labels.count(list->getLabel()) == 1){
                                
-                               error = process(list, count);   
+                               error = process(list);  
                                if (error == 1) { return 0; }   
                                                        
                                processedLabels.insert(list->getLabel());
@@ -182,7 +182,7 @@ int BinSeqCommand::execute(){
                                delete list;
                                list = input->getListVector(lastLabel);
                                
-                               error = process(list, count);   
+                               error = process(list);  
                                if (error == 1) { return 0; }
                                                                                                        
                                processedLabels.insert(list->getLabel());
@@ -216,7 +216,7 @@ int BinSeqCommand::execute(){
                        delete list;
                        list = input->getListVector(lastLabel);
                                
-                       error = process(list, count);   
+                       error = process(list);  
                        if (error == 1) { return 0; }
                        
                        delete list;  
@@ -265,13 +265,13 @@ void BinSeqCommand::readNamesFile() {
 }
 //**********************************************************************************************************************
 //return 1 if error, 0 otherwise
-int BinSeqCommand::process(ListVector* list, int count) {
+int BinSeqCommand::process(ListVector* list) {
        try {
                                string binnames, name, sequence;
                                string outputFileName = getRootName(globaldata->getListFile()) + list->getLabel() + ".fasta";
                                openOutputFile(outputFileName, out);
 
-                               mothurOut(list->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(list->getLabel()); mothurOutEndLine();
                                
                                //for each bin in the list vector
                                for (int i = 0; i < list->size(); i++) {
index 6f9f69d3a7b13dbabe73c09e21e787f55dadff81..8ea88cbfcff767eec8461df493cea50217675404 100644 (file)
@@ -44,7 +44,7 @@ private:
        ifstream in, inNames;
        
        void readNamesFile();
-       int process(ListVector*, int);
+       int process(ListVector*);
 };
 
 #endif
index a3717fe621057f9b8b9a88f09545c79438a2c032..12c0b5e647fefccded7b826e23efb7d019e1b703 100644 (file)
@@ -228,7 +228,7 @@ int BootSharedCommand::execute(){
                
                        if(allLines == 1 || lines.count(count) == 1 || labels.count(order->getLabel()) == 1){                   
                                
-                               mothurOut(order->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(order->getLabel()); mothurOutEndLine();
                                process(order);
                                
                                processedLabels.insert(order->getLabel());
@@ -241,7 +241,7 @@ int BootSharedCommand::execute(){
                                
                                delete order;
                                order = input->getSharedOrderVector(lastLabel);                                                                                                 
-                               mothurOut(order->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(order->getLabel()); mothurOutEndLine();
                                process(order);
 
                                processedLabels.insert(order->getLabel());
@@ -274,7 +274,7 @@ int BootSharedCommand::execute(){
                if (needToRun == true)  {
                                delete order;
                                order = input->getSharedOrderVector(lastLabel);                                                                                                 
-                               mothurOut(order->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(order->getLabel()); mothurOutEndLine();
                                process(order);
                                delete order;
 
index 24521f570e4124a0efa56d1d55c75ed510770728..590c20eeec65215f087bf36fd51593624e02ce02 100644 (file)
--- a/chao1.cpp
+++ b/chao1.cpp
@@ -15,9 +15,19 @@ EstOutput Chao1::getValues(SAbundVector* rank){
                data.resize(3,0);
        
                double sobs = (double)rank->getNumBins();
-       
-               double singles = (double)rank->get(1);
-               double doubles = (double)rank->get(2);
+               
+               //this is a modification do to a vector fill error that occurs when an empty sharedRabund creates a sabund
+               //in that case there is no 1 0r 2.
+               double singles;
+               if (rank->size() > 1) {
+                       singles = (double)rank->get(1);
+               }else{ singles = 0.0;  }
+
+               double doubles;
+               if (rank->size() > 2) {
+                        doubles = (double)rank->get(2);
+               }else{ doubles = 0.0;  }
+
                double chaovar = 0.0000;
 //cout << "singles = " << singles << " doubles = " << doubles << " sobs = " << sobs << endl;   
                double chao = sobs + singles*(singles-1)/(2*(doubles+1));
index c3a58d6768d834487364b0844e2892219fe05873..fac13ecab2a6ca88e8de8cc2aded29eaac0630f7 100644 (file)
@@ -227,7 +227,7 @@ int CollectCommand::execute(){
                                cCurve->getCurve(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);
@@ -244,7 +244,7 @@ int CollectCommand::execute(){
                                cCurve->getCurve(freq);
                                delete cCurve;
                        
-                               mothurOut(order->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(order->getLabel()); mothurOutEndLine();
                                processedLabels.insert(order->getLabel());
                                userLabels.erase(order->getLabel());
                        }
@@ -274,7 +274,7 @@ int CollectCommand::execute(){
                        delete order;
                        order = (input->getOrderVector(lastLabel));
                        
-                       mothurOut(order->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                       mothurOut(order->getLabel()); mothurOutEndLine();
                        
                        cCurve = new Collect(order, cDisplays);
                        cCurve->getCurve(freq);
index 4fe358800dba8dd40a1132f8330ca7ebe5671956..0f18da6277853059464b1902aeb81b92a3facae1 100644 (file)
@@ -76,7 +76,10 @@ public:
        void close()                    {       output->resetFile();    };
        bool isCalcMultiple() { return estimate->getMultiple(); }
        
+       string getName()        {  return estimate->getName();  }
+
 private:
+       
        Calculator* estimate;
        FileOutput* output;
        int nSeqs, timesCalled, numGroupComb;
index 5cbe2be6c38ad5762d9e5c8bd8ce47d30e9a9a6f..d90e84acdf0989e53b5caf18f3a6a7a202bea28e 100644 (file)
@@ -47,6 +47,7 @@ public:
        
        void notifyDisplays(){  
                for(set<Display*>::iterator pos=displays.begin();pos!=displays.end();pos++){
+//cout << (*pos)->getName() << endl;
                        if ( ((*pos)->isCalcMultiple() == true) || ( ((*pos)->isCalcMultiple() == false) && (shared.size() == 2) ) ) {
                                (*pos)->update(shared, NumSeqs, NumGroupComb);
                        }
index ee827e51ff66a3faa7f2d3cd05ff82d131579345..398d68470cbf0f957c0b24c733bde6cde823a8d0 100644 (file)
--- a/display.h
+++ b/display.h
@@ -18,10 +18,11 @@ public:
        virtual void reset() = 0;
        virtual void close() = 0;
        virtual bool isCalcMultiple() = 0;
+       virtual string getName() { return ""; };
        virtual ~Display() {}
        
 private:
-
+       
 };
 
 /***********************************************************************/
index 597a05a6ad9a892caff5f0b6f69269ae6af4013d..004ed8313511c2dd42d4b87aca93c0ad5750bce5 100644 (file)
@@ -82,8 +82,10 @@ void ThreeColumnFile::resetFile(){
                renameOk = rename(outName.c_str(), inName.c_str());
                
                //checks to make sure user was able to rename and remove successfully
-               if ((renameOk != 0)) {  mothurOut("Unable to rename necessary files."); mothurOutEndLine(); }
-
+               if ((renameOk != 0)) { 
+                       mothurOut("Unable to rename " + outName); mothurOutEndLine();
+                       perror(" : ");
+               }       
        }
        catch(exception& e) {
                errorOut(e, "ThreeColumnFile", "resetFile");
@@ -182,8 +184,10 @@ void ColumnFile::resetFile(){
                renameOk = rename(outName.c_str(), inName.c_str());
                
                //checks to make sure user was able to rename and remove successfully
-               if ((renameOk != 0)) { mothurOut("Unable to rename necessary files."); mothurOutEndLine(); }
-
+               if ((renameOk != 0)) { 
+                       mothurOut("Unable to rename " + outName); mothurOutEndLine();
+                       perror(" : ");
+               }       
        }
        catch(exception& e) {
                errorOut(e, "ColumnFile", "resetFile");
@@ -265,8 +269,10 @@ void SharedThreeColumnFile::resetFile(){
                renameOk = rename(outName.c_str(), inName.c_str());
                
                //checks to make sure user was able to rename and remove successfully
-               if ((renameOk != 0)) { mothurOut("Unable to rename necessary files."); mothurOutEndLine(); }
-
+               if ((renameOk != 0)) { 
+                       mothurOut("Unable to rename " + outName); mothurOutEndLine();
+                       perror(" : ");
+               }       
        }
        catch(exception& e) {
                errorOut(e, "SharedThreeColumnFile", "resetFile");
@@ -348,8 +354,10 @@ void OneColumnFile::resetFile(){
                renameOk = rename(outName.c_str(), inName.c_str());
                
                //checks to make sure user was able to rename and remove successfully
-               if ((renameOk != 0)) { mothurOut("Unable to rename necessary files."); mothurOutEndLine(); }
-
+               if ((renameOk != 0)) { 
+                       mothurOut("Unable to rename " + outName); mothurOutEndLine();
+                       perror(" : ");
+               }       
        }
        catch(exception& e) {
                errorOut(e, "OneColumnFile", "resetFile");
@@ -435,14 +443,16 @@ void SharedOneColumnFile::resetFile(){
                        outFile.close();
                }       
                counter = 1;
-               
+
                remove(inName.c_str());
+
                renameOk = rename(outName.c_str(), inName.c_str());
                
                //checks to make sure user was able to rename and remove successfully
-               if ((renameOk != 0)) { mothurOut("Unable to rename necessary files."); mothurOutEndLine(); }
-
-               
+               if ((renameOk != 0)) { 
+                       mothurOut("Unable to rename " + outName); mothurOutEndLine();
+                       perror(" : ");
+               }       
        }
        catch(exception& e) {
                errorOut(e, "SharedOneColumnFile", "resetFile");
index 92ba3ad5214cee119f9dcee08c256e1b1a2f79be..4aab74080f815532ae5a0f38af09981e5fe521ec 100644 (file)
@@ -204,7 +204,7 @@ int GetOTURepCommand::execute(){
                while((list != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                        
                        if (allLines == 1 || lines.count(count) == 1 || labels.count(list->getLabel()) == 1){
-                                       mothurOut(list->getLabel() + "\t" + toString(list->size()) + "\t" + toString(count)); mothurOutEndLine();
+                                       mothurOut(list->getLabel() + "\t" + toString(list->size())); mothurOutEndLine();
                                        error = process(list);
                                        if (error == 1) { return 0; } //there is an error in hte input files, abort command
                                        
@@ -216,7 +216,7 @@ int GetOTURepCommand::execute(){
                        if ((anyLabelsToProcess(list->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
                                        delete list;
                                        list = input->getListVector(lastLabel);
-                                       mothurOut(list->getLabel() + "\t" + toString(list->size()) + "\t" + toString(count)); mothurOutEndLine();
+                                       mothurOut(list->getLabel() + "\t" + toString(list->size())); mothurOutEndLine();
                                        error = process(list);
                                        if (error == 1) { return 0; } //there is an error in hte input files, abort command
                                        
@@ -247,7 +247,7 @@ int GetOTURepCommand::execute(){
                if (needToRun == true)  {
                        delete list;
                        list = input->getListVector(lastLabel);
-                       mothurOut(list->getLabel() + "\t" + toString(list->size()) + "\t" + toString(count)); mothurOutEndLine();
+                       mothurOut(list->getLabel() + "\t" + toString(list->size())); mothurOutEndLine();
                        error = process(list);
                        delete list;
                        if (error == 1) { return 0; } //there is an error in hte input files, abort command
index b0bf81980a54d7bb6f8992b49f0af83d3169f4f8..8718e1600625d03e6311cf782ea3155b9b72747f 100644 (file)
@@ -134,7 +134,7 @@ int GetRAbundCommand::execute(){
                while((list != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                        
                        if(allLines == 1 || lines.count(count) == 1 || labels.count(list->getLabel()) == 1){
-                                       mothurOut(list->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                                       mothurOut(list->getLabel()); mothurOutEndLine();
                                        rabund = new RAbundVector();                            
                                        *rabund = (list->getRAbundVector());
                                        
@@ -152,7 +152,7 @@ int GetRAbundCommand::execute(){
                                        delete list;
                                        list = input->getListVector(lastLabel);
                                        
-                                       mothurOut(list->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                                       mothurOut(list->getLabel()); mothurOutEndLine();
                                        rabund = new RAbundVector();
                                        *rabund = (list->getRAbundVector());
                                        
@@ -190,7 +190,7 @@ int GetRAbundCommand::execute(){
                        delete list;
                        list = input->getListVector(lastLabel);
                        
-                       mothurOut(list->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                       mothurOut(list->getLabel()); mothurOutEndLine();
                        rabund = new RAbundVector();
                        *rabund = (list->getRAbundVector());
                        
index 0be26ce1855e5137668b9e4dabc49af9f230ad77..5d99b6917b0130e0bec11742ab8fa862c4613db6 100644 (file)
@@ -127,7 +127,7 @@ int GetSAbundCommand::execute(){
                while((order != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                        
                        if(allLines == 1 || lines.count(count) == 1 || labels.count(order->getLabel()) == 1){
-                                       mothurOut(order->getLabel() + "\t" + toString(count));  mothurOutEndLine();
+                                       mothurOut(order->getLabel());  mothurOutEndLine();
                                        sabund = new SAbundVector();
                                        *sabund = (order->getSAbundVector());
                                        sabund->print(out);
@@ -142,7 +142,7 @@ int GetSAbundCommand::execute(){
                                        delete order;           
                                        order = (input->getOrderVector(lastLabel));
                                        
-                                       mothurOut(order->getLabel() + "\t" + toString(count));  mothurOutEndLine();
+                                       mothurOut(order->getLabel());  mothurOutEndLine();
                                        sabund = new SAbundVector();
                                        *sabund = (order->getSAbundVector());
                                        sabund->print(out);
@@ -178,7 +178,7 @@ int GetSAbundCommand::execute(){
                        delete order;           
                        order = (input->getOrderVector(lastLabel));
                        
-                       mothurOut(order->getLabel() + "\t" + toString(count));  mothurOutEndLine();
+                       mothurOut(order->getLabel());  mothurOutEndLine();
                        sabund = new SAbundVector();
                        *sabund = (order->getSAbundVector());
                        sabund->print(out);
index e21b14dce5afaf3744b1338416b1af3630a6830c..271a379cfefa2d238a9ac1b18b52412ab87ede7f 100644 (file)
@@ -168,7 +168,7 @@ int HeatMapCommand::execute(){
                
                                if(allLines == 1 || lines.count(count) == 1 || labels.count(lookup[0]->getLabel()) == 1){                       
        
-                                       mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                                       mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                        heatmap->getPic(lookup);
                                        
                                        processedLabels.insert(lookup[0]->getLabel());
@@ -179,7 +179,7 @@ int HeatMapCommand::execute(){
                                if ((anyLabelsToProcess(lookup[0]->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
                                        for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  }  
                                        lookup = input->getSharedRAbundVectors(lastLabel);
-                                       mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                                       mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                        
                                        heatmap->getPic(lookup);
                                        
@@ -214,7 +214,7 @@ int HeatMapCommand::execute(){
                                for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  }  
                                lookup = input->getSharedRAbundVectors(lastLabel);
                                
-                               mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                heatmap->getPic(lookup);
                                for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  }
                        }
@@ -230,7 +230,7 @@ int HeatMapCommand::execute(){
 
                                if(allLines == 1 || lines.count(count) == 1 || labels.count(rabund->getLabel()) == 1){                  
        
-                                       mothurOut(rabund->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                                       mothurOut(rabund->getLabel()); mothurOutEndLine();
                                        heatmap->getPic(rabund);
                                        
                                        processedLabels.insert(rabund->getLabel());
@@ -242,7 +242,7 @@ int HeatMapCommand::execute(){
 
                                        delete rabund;
                                        rabund = input->getRAbundVector(lastLabel);
-                                       mothurOut(rabund->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                                       mothurOut(rabund->getLabel()); mothurOutEndLine();
                                        
                                        heatmap->getPic(rabund);
                                        
@@ -276,7 +276,7 @@ int HeatMapCommand::execute(){
                
                                delete rabund;
                                rabund = input->getRAbundVector(lastLabel);
-                               mothurOut(rabund->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(rabund->getLabel()); mothurOutEndLine();
                                        
                                heatmap->getPic(rabund);
                                delete rabund; globaldata->rabund = NULL;
index b9216e4a990e7818c4ed5ce8759c706a44530c26..1b0029839b432bb2a3cf8392c6121ed84e107d6e 100644 (file)
@@ -204,7 +204,7 @@ int HeatMapSimCommand::execute(){
                
                        if(allLines == 1 || lines.count(count) == 1 || labels.count(lookup[0]->getLabel()) == 1){                       
        
-                               mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                heatmap->getPic(lookup, heatCalculators);
                                        
                                processedLabels.insert(lookup[0]->getLabel());
@@ -217,7 +217,7 @@ int HeatMapSimCommand::execute(){
                                for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
                                lookup = input->getSharedRAbundVectors(lastLabel);                              
 
-                               mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                heatmap->getPic(lookup, heatCalculators);
                                        
                                processedLabels.insert(lookup[0]->getLabel());
@@ -252,7 +252,7 @@ int HeatMapSimCommand::execute(){
                        for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
                        lookup = input->getSharedRAbundVectors(lastLabel);                              
 
-                       mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                       mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                        heatmap->getPic(lookup, heatCalculators);
                        for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
                }
index 64ec2a5f6440f23f7beef0e11c0be73560523114..00dff4bc963cb277787bc232f6ae4a3484084542 100644 (file)
@@ -202,7 +202,7 @@ int MatrixOutputCommand::execute(){
                while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                
                        if(allLines == 1 || lines.count(count) == 1 || labels.count(lookup[0]->getLabel()) == 1){                       
-                               mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                process(lookup);
                                
                                processedLabels.insert(lookup[0]->getLabel());
@@ -215,7 +215,7 @@ int MatrixOutputCommand::execute(){
                                for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
                                lookup = input->getSharedRAbundVectors(lastLabel);
 
-                               mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                process(lookup);
                                
                                processedLabels.insert(lookup[0]->getLabel());
@@ -249,7 +249,7 @@ int MatrixOutputCommand::execute(){
                        for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
                        lookup = input->getSharedRAbundVectors(lastLabel);
 
-                       mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                       mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                        process(lookup);
                        for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
                }
index 5b519bb2111d27259d1969f81e41b805e4a33935..ed206af809e4f369b12015ed0406966d12992a72 100644 (file)
--- a/mothur.h
+++ b/mothur.h
 #include <cerrno>
 #include <ctime>
 #include <limits>
-#include <unistd.h>
+
 
 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
        #include <sys/wait.h>
+       #include <unistd.h>
 #endif
 
 using namespace std;
index ee0c38f4d05de762222c284fb6e94c74569a95e5..41c38e86899f35d0dfc93e6f54a6f63b6f845254 100644 (file)
@@ -203,7 +203,7 @@ int RareFactCommand::execute(){
                                rCurve->getCurve(freq, nIters);
                                delete rCurve;
                        
-                               mothurOut(order->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(order->getLabel()); mothurOutEndLine();
                                processedLabels.insert(order->getLabel());
                                userLabels.erase(order->getLabel());
                                userLines.erase(count);
@@ -217,7 +217,7 @@ int RareFactCommand::execute(){
                                rCurve->getCurve(freq, nIters);
                                delete rCurve;
                        
-                               mothurOut(order->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(order->getLabel()); mothurOutEndLine();
                                processedLabels.insert(order->getLabel());
                                userLabels.erase(order->getLabel());
                        }
@@ -251,7 +251,7 @@ int RareFactCommand::execute(){
                        rCurve->getCurve(freq, nIters);
                        delete rCurve;
                        
-                       mothurOut(order->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                       mothurOut(order->getLabel()); mothurOutEndLine();
                        delete order;
                }
                
index 5914f156a1a01831ce7cf6d2f3c52696c529f466..79bf7bb113ddd682849421f577c80fee3baff082 100644 (file)
@@ -196,7 +196,7 @@ int RareFactSharedCommand::execute(){
                                rCurve->getSharedCurve(freq, nIters);
                                delete rCurve;
                        
-                               mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                processedLabels.insert(lookup[0]->getLabel());
                                userLabels.erase(lookup[0]->getLabel());
                                userLines.erase(count);
@@ -206,7 +206,7 @@ int RareFactSharedCommand::execute(){
                                        for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
                                        lookup = input->getSharedRAbundVectors(lastLabel);
 
-                                       mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                                       mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                        rCurve = new Rarefact(lookup, rDisplays);
                                        rCurve->getSharedCurve(freq, nIters);
                                        delete rCurve;
@@ -242,7 +242,7 @@ int RareFactSharedCommand::execute(){
                        for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
                        lookup = input->getSharedRAbundVectors(lastLabel);
 
-                       mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                       mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                        rCurve = new Rarefact(lookup, rDisplays);
                        rCurve->getSharedCurve(freq, nIters);
                        delete rCurve;
index cbb519241bd98e85823ef1fc25f33701dbeb84e9..a28f6092e8269bca28e5269952772758883ee64d 100644 (file)
@@ -48,7 +48,7 @@ EstOutput SharedChao1::getValues(vector<SharedRAbundVector*> shared){
 
                        
                //calculate chao1, (numleaves-1) because numleaves contains the ++ values.
-               bool bias;
+               bool bias = false;
                for(int i=0;i<numLeaves;i++){
                        if (f2leaves[i]->lvalue == 0 || f2leaves[i]->rvalue == 0) { bias = true;}// break;}
                }
index 9afb401014faaf097a1a30c2b1802d82ae8e659f..c49e56ac8d9264f535a7b9c6f7457948f421f69a 100644 (file)
@@ -75,7 +75,7 @@ int SharedCommand::execute(){
                        if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(SharedList->getLabel()) == 1){
                                        
                                        lookup = SharedList->getSharedRAbundVector();
-                                       mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                                       mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                        
                                        printSharedData(lookup); //prints info to the .shared file
                                        for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  }
@@ -90,7 +90,7 @@ int SharedCommand::execute(){
                                        SharedList = input->getSharedListVector(lastLabel); //get new list vector to process
                                        
                                        lookup = SharedList->getSharedRAbundVector();
-                                       mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                                       mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                        
                                        printSharedData(lookup); //prints info to the .shared file
                                        for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  }
@@ -123,7 +123,7 @@ int SharedCommand::execute(){
                        SharedList = input->getSharedListVector(lastLabel); //get new list vector to process
                                        
                        lookup = SharedList->getSharedRAbundVector();
-                       mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                       mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                        
                        printSharedData(lookup); //prints info to the .shared file
                        for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  }
index 228b93344d50967a065328be487dc30fc1d6c34c..6ef1faeef4147bdedbaaa31f14076c8a078a1622 100644 (file)
@@ -236,7 +236,7 @@ int SummaryCommand::execute(){
                        
                        if(allLines == 1 || lines.count(count) == 1 || labels.count(sabund->getLabel()) == 1){                  
        
-                               mothurOut(sabund->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(sabund->getLabel()); mothurOutEndLine();
                                processedLabels.insert(sabund->getLabel());
                                userLabels.erase(sabund->getLabel());
                                userLines.erase(count);
@@ -255,7 +255,7 @@ int SummaryCommand::execute(){
                                delete sabund;
                                sabund = input->getSAbundVector(lastLabel);
                                
-                               mothurOut(sabund->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(sabund->getLabel()); mothurOutEndLine();
                                processedLabels.insert(sabund->getLabel());
                                userLabels.erase(sabund->getLabel());
                                
@@ -293,7 +293,7 @@ int SummaryCommand::execute(){
                        delete sabund;
                        sabund = input->getSAbundVector(lastLabel);
                        
-                       mothurOut(sabund->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                       mothurOut(sabund->getLabel()); mothurOutEndLine();
                        outputFileHandle << sabund->getLabel();
                        for(int i=0;i<sumCalculators.size();i++){
                                vector<double> data = sumCalculators[i]->getValues(sabund);
index 253c3382d9cfcfc94a59a90e990bf2474afe1ac5..74327ba684a535d0dd62125a5848e159bf6ddcc9 100644 (file)
@@ -273,7 +273,7 @@ int SummarySharedCommand::execute(){
                while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                
                        if(allLines == 1 || lines.count(count) == 1 || labels.count(lookup[0]->getLabel()) == 1){                       
-                               mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                process(lookup);
                                
                                processedLabels.insert(lookup[0]->getLabel());
@@ -285,7 +285,7 @@ int SummarySharedCommand::execute(){
                                        for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
                                        lookup = input->getSharedRAbundVectors(lastLabel);
 
-                                       mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                                       mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                        process(lookup);
                                        
                                        processedLabels.insert(lookup[0]->getLabel());
@@ -321,7 +321,7 @@ int SummarySharedCommand::execute(){
                                for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
                                lookup = input->getSharedRAbundVectors(lastLabel);
 
-                               mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                process(lookup);
                                for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
                }
index 487db5c5f84805edcd232607472129ea98a86a4f..5331dba9bf46fad1c5551ae9c84799648284082b 100644 (file)
--- a/tree.cpp
+++ b/tree.cpp
@@ -159,11 +159,10 @@ map<string, int> Tree::mergeGroups(int i) {
                // this is true if right child had a greater parsimony for a certain group
                if(maxPars > 1){
                        //erase all the groups that are only 1 because you found something with 2.
-                       for(it=parsimony.begin();it!=parsimony.end();it++){
+                       for(it=parsimony.begin();it!=parsimony.end();){
                                if(it->second == 1){
-                                       parsimony.erase(it->first);
-//                                     it--;
-                               }
+                                       parsimony.erase(it++);
+                               }else { it++; }
                        }
                        //set one remaining groups to 1
                        //so with our above example p[white] = 2 would be left and it would become p[white] = 1
@@ -193,13 +192,17 @@ map<string, int> Tree::mergeUserGroups(int i, vector<string> g) {
                int rc = tree[i].getRChild();
                
                //loop through nodes groups removing the ones the user doesn't want
-               for (it = tree[lc].pGroups.begin(); it != tree[lc].pGroups.end(); it++) {
-                       if (inUsersGroups(it->first, g) != true) { tree[lc].pGroups.erase(it->first); }
+               for(it=tree[lc].pGroups.begin();it!=tree[lc].pGroups.end();){
+                               if (inUsersGroups(it->first, g) != true) {
+                                       tree[lc].pGroups.erase(it++);
+                               }else { it++; }
                }
-               
+
                //loop through nodes groups removing the ones the user doesn't want
-               for (it = tree[rc].pGroups.begin(); it != tree[rc].pGroups.end(); it++) {
-                       if (inUsersGroups(it->first, g) != true) { tree[rc].pGroups.erase(it->first); }
+               for(it=tree[rc].pGroups.begin();it!=tree[rc].pGroups.end();){
+                               if (inUsersGroups(it->first, g) != true) {
+                                       tree[rc].pGroups.erase(it++);
+                               }else { it++; }
                }
 
                //set parsimony groups to left child
@@ -224,11 +227,12 @@ map<string, int> Tree::mergeUserGroups(int i, vector<string> g) {
                // this is true if right child had a greater parsimony for a certain group
                if(maxPars > 1){
                        //erase all the groups that are only 1 because you found something with 2.
-                       for(it=parsimony.begin();it!=parsimony.end();it++){
+                       for(it=parsimony.begin();it!=parsimony.end();){
                                if(it->second == 1){
-                                       parsimony.erase(it->first);
-                               }
+                                       parsimony.erase(it++);
+                               }else { it++; }
                        }
+
                        for(it=parsimony.begin();it!=parsimony.end();it++){
                                parsimony[it->first] = 1;
                        }
index dae04f556490260903f99b4f349d6faea249e26e..ab81f42a08d80dfebb8cb7f784623bbd3e421100 100644 (file)
@@ -448,7 +448,7 @@ void TreeGroupCommand::makeSimsShared() {
                while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                
                        if(allLines == 1 || lines.count(count) == 1 || labels.count(lookup[0]->getLabel()) == 1){                       
-                               mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                process(lookup);
                                
                                processedLabels.insert(lookup[0]->getLabel());
@@ -460,7 +460,7 @@ void TreeGroupCommand::makeSimsShared() {
                                for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
                                lookup = input->getSharedRAbundVectors(lastLabel);
 
-                               mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                process(lookup);
                                        
                                processedLabels.insert(lookup[0]->getLabel());
@@ -493,7 +493,7 @@ void TreeGroupCommand::makeSimsShared() {
                        for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
                        lookup = input->getSharedRAbundVectors(lastLabel);
 
-                       mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                       mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                        process(lookup);
                        for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  }         
                }
index 38cf8cb6a1c189c2f2d3451d63c3891c65dbe499..84d33f226c760a100b05d38f6cdf89cb8c041112 100644 (file)
@@ -224,7 +224,7 @@ int VennCommand::execute(){
                        while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
 
                                if(allLines == 1 || lines.count(count) == 1 || labels.count(lookup[0]->getLabel()) == 1){                       
-                                       mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                                       mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                        processedLabels.insert(lookup[0]->getLabel());
                                        userLabels.erase(lookup[0]->getLabel());
                                        userLines.erase(count);
@@ -240,7 +240,7 @@ int VennCommand::execute(){
                                        for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
                                        lookup = input->getSharedRAbundVectors(lastLabel);
 
-                                       mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                                       mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                        processedLabels.insert(lookup[0]->getLabel());
                                        userLabels.erase(lookup[0]->getLabel());
 
@@ -278,7 +278,7 @@ int VennCommand::execute(){
                                        for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
                                        lookup = input->getSharedRAbundVectors(lastLabel);
 
-                                       mothurOut(lookup[0]->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                                       mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
                                        processedLabels.insert(lookup[0]->getLabel());
                                        userLabels.erase(lookup[0]->getLabel());
 
@@ -300,7 +300,7 @@ int VennCommand::execute(){
                
                                if(allLines == 1 || lines.count(count) == 1 || labels.count(sabund->getLabel()) == 1){                  
        
-                                       mothurOut(sabund->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                                       mothurOut(sabund->getLabel()); mothurOutEndLine();
                                        venn->getPic(sabund, vennCalculators);
                                        
                                        processedLabels.insert(sabund->getLabel());
@@ -312,7 +312,7 @@ int VennCommand::execute(){
                                        delete sabund;
                                        sabund = input->getSAbundVector(lastLabel);
                                        
-                                       mothurOut(sabund->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                                       mothurOut(sabund->getLabel()); mothurOutEndLine();
                                        venn->getPic(sabund, vennCalculators);
                                        
                                        processedLabels.insert(sabund->getLabel());
@@ -344,7 +344,7 @@ int VennCommand::execute(){
                                delete sabund;
                                sabund = input->getSAbundVector(lastLabel);
                                        
-                               mothurOut(sabund->getLabel() + "\t" + toString(count)); mothurOutEndLine();
+                               mothurOut(sabund->getLabel()); mothurOutEndLine();
                                venn->getPic(sabund, vennCalculators);
                                delete sabund;