]> git.donarmstrong.com Git - mothur.git/commitdiff
fixed some issues while testing 1.6
authorwestcott <westcott>
Tue, 15 Sep 2009 17:43:32 +0000 (17:43 +0000)
committerwestcott <westcott>
Tue, 15 Sep 2009 17:43:32 +0000 (17:43 +0000)
23 files changed:
Mothur.xcodeproj/project.pbxproj
binsequencecommand.cpp
bootstrapsharedcommand.cpp
chimera.cpp
collectcommand.cpp
collectsharedcommand.cpp
getoturepcommand.cpp
getrabundcommand.cpp
getsabundcommand.cpp
heatmapcommand.cpp
heatmapsimcommand.cpp
matrixoutputcommand.cpp
mothur.cpp
mothur.h
rarefactcommand.cpp
rarefactsharedcommand.cpp
readdistcommand.cpp
sharedcommand.cpp
summarycommand.cpp
summarysharedcommand.cpp
treegroupscommand.cpp
unifracweightedcommand.h
venncommand.cpp

index 6aa6b2774a80080173293dc3af259e01952f1d49..fda0adcb25e16f7388a8aad0dd67cf8b37373e03 100644 (file)
                A70B53A70F4CD7AD0064797E /* getlabelcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getlabelcommand.h; sourceTree = SOURCE_ROOT; };
                A70B53A80F4CD7AD0064797E /* getlinecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getlinecommand.cpp; sourceTree = SOURCE_ROOT; };
                A70B53A90F4CD7AD0064797E /* getlinecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getlinecommand.h; sourceTree = SOURCE_ROOT; };
-               A7283FF61056CAE100D0CC69 /* chimeracheckrdp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chimeracheckrdp.h; sourceTree = "<group>"; };
-               A7283FF71056CAE100D0CC69 /* chimeracheckrdp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = chimeracheckrdp.cpp; sourceTree = "<group>"; };
+               A7283FF61056CAE100D0CC69 /* chimeracheckrdp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chimeracheckrdp.h; sourceTree = SOURCE_ROOT; };
+               A7283FF71056CAE100D0CC69 /* chimeracheckrdp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = chimeracheckrdp.cpp; sourceTree = SOURCE_ROOT; };
                A75B887B104C16860083C454 /* ccode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ccode.cpp; sourceTree = SOURCE_ROOT; };
                A75B887C104C16860083C454 /* ccode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccode.h; sourceTree = SOURCE_ROOT; };
                C6859E8B029090EE04C91782 /* Mothur.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = Mothur.1; sourceTree = "<group>"; };
index e1f98eb94a02b6ef39073270e5c0d09f55e69025..e4e4c48d98e06014ee7a243fa6e43672445b0c5d 100644 (file)
@@ -213,7 +213,7 @@ int BinSeqCommand::execute(){
                
                //run last line if you need to
                if (needToRun == true)  {
-                       delete list;
+                       if (list != NULL) {             delete list;    }
                        list = input->getListVector(lastLabel);
                                
                        error = process(list);  
index 12c0b5e647fefccded7b826e23efb7d019e1b703..0c6c53c0652df0786b885966919f3ce15a2f5197 100644 (file)
@@ -272,7 +272,7 @@ int BootSharedCommand::execute(){
                
                //run last line if you need to
                if (needToRun == true)  {
-                               delete order;
+                               if (order != NULL) {    delete order;   }
                                order = input->getSharedOrderVector(lastLabel);                                                                                                 
                                mothurOut(order->getLabel()); mothurOutEndLine();
                                process(order);
index 7e997b9824439e4e42f495f95a2d101b58a89600..6ec24d155263e86951ed600ac59cbbe05c932581 100644 (file)
@@ -142,7 +142,7 @@ vector< vector<float> > Chimera::readQuantiles() {
                openInputFile(quanfile, in);
                
                vector< vector<float> > quan;
-               vector <float> temp;
+               vector <float> temp; temp.resize(6, 0);
                
                //to fill 0
                quan.push_back(temp); 
index fac13ecab2a6ca88e8de8cc2aded29eaac0630f7..58aa32cd785343419f0395acccf1dbe6b7bfa10b 100644 (file)
@@ -271,7 +271,7 @@ int CollectCommand::execute(){
                
                //run last line if you need to
                if (needToRun == true)  {
-                       delete order;
+                       if (order != NULL) {    delete order;   }
                        order = (input->getOrderVector(lastLabel));
                        
                        mothurOut(order->getLabel()); mothurOutEndLine();
index ae2c52e7c03a9c713930bd77edc22bc402a1b51f..697bc5340d66d54f9bdfcd8505bd8927a7e0ac57 100644 (file)
@@ -296,11 +296,11 @@ int CollectSharedCommand::execute(){
                
                //run last line if you need to
                if (needToRun == true)  {
-                       delete order;
+                       if (order != NULL) {  delete order;  }
                        order = input->getSharedOrderVector(lastLabel);
 
                        cCurve = new Collect(order, cDisplays);
-                       cCurve->getCurve(freq);
+                       cCurve->getSharedCurve(freq);
                        delete cCurve;
                        
                        mothurOut(order->getLabel()); mothurOutEndLine();
index 4aab74080f815532ae5a0f38af09981e5fe521ec..441e82438b54c33891d4e80e54cbf38410ca6a87 100644 (file)
@@ -245,7 +245,7 @@ int GetOTURepCommand::execute(){
                
                //run last line if you need to
                if (needToRun == true)  {
-                       delete list;
+                       if (list != NULL) {     delete list;    }
                        list = input->getListVector(lastLabel);
                        mothurOut(list->getLabel() + "\t" + toString(list->size())); mothurOutEndLine();
                        error = process(list);
index 8718e1600625d03e6311cf782ea3155b9b72747f..dd4fdd58178a0ce13467d5f45a00a105a8954fca 100644 (file)
@@ -187,7 +187,7 @@ int GetRAbundCommand::execute(){
                
                //run last line if you need to
                if (needToRun == true)  {
-                       delete list;
+                       if (list != NULL) {     delete list;    }
                        list = input->getListVector(lastLabel);
                        
                        mothurOut(list->getLabel()); mothurOutEndLine();
index 5d99b6917b0130e0bec11742ab8fa862c4613db6..8cbb9d4a06ed2c3d578821520968f47630f6c0ce 100644 (file)
@@ -175,7 +175,7 @@ int GetSAbundCommand::execute(){
                
                //run last line if you need to
                if (needToRun == true)  {
-                       delete order;           
+                       if (order != NULL) {    delete order;   }
                        order = (input->getOrderVector(lastLabel));
                        
                        mothurOut(order->getLabel());  mothurOutEndLine();
index 271a379cfefa2d238a9ac1b18b52412ab87ede7f..e2fdc645a83dfd72574bc8f14a61db30b74b4e45 100644 (file)
@@ -211,7 +211,7 @@ int HeatMapCommand::execute(){
                
                        //run last line if you need to
                        if (needToRun == true)  {
-                               for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  }  
+                               for (int i = 0; i < lookup.size(); i++) { if (lookup[i] != NULL) { delete lookup[i]; } }  
                                lookup = input->getSharedRAbundVectors(lastLabel);
                                
                                mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
@@ -274,7 +274,7 @@ int HeatMapCommand::execute(){
                        //run last line if you need to
                        if (needToRun == true)  {
                
-                               delete rabund;
+                               if (rabund != NULL) {   delete rabund;  }
                                rabund = input->getRAbundVector(lastLabel);
                                mothurOut(rabund->getLabel()); mothurOutEndLine();
                                        
index 1b0029839b432bb2a3cf8392c6121ed84e107d6e..004a3bf05a901262ca1233e16ceb862d9b5f9ebd 100644 (file)
@@ -249,7 +249,7 @@ int HeatMapSimCommand::execute(){
                
                //run last line if you need to
                if (needToRun == true)  {
-                       for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
+                       for (int i = 0; i < lookup.size(); i++) {  if (lookup[i] != NULL) { delete lookup[i]; } } 
                        lookup = input->getSharedRAbundVectors(lastLabel);                              
 
                        mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
index 00dff4bc963cb277787bc232f6ae4a3484084542..9b4935f5ec076ddc870ed7716b0588184e13dee4 100644 (file)
@@ -246,7 +246,7 @@ int MatrixOutputCommand::execute(){
                
                //run last line if you need to
                if (needToRun == true)  {
-                       for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
+                       for (int i = 0; i < lookup.size(); i++) {  if (lookup[i] != NULL) {  delete lookup[i]; }  } 
                        lookup = input->getSharedRAbundVectors(lastLabel);
 
                        mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
index 5bb9c05d294d1cf909190659637d9e6a2232cfde..99ff5c6ee54e6e25c402bed6c19685f65b01d86f 100644 (file)
@@ -41,9 +41,9 @@ int main(int argc, char *argv[]){
 
                
                //header
-               mothurOut("mothur v.1.5.1");
+               mothurOut("mothur v.1.6.0");
                mothurOutEndLine();             
-               mothurOut("Last updated: 9/02/2009");
+               mothurOut("Last updated: 9/15/2009");
                mothurOutEndLine();     
                mothurOutEndLine();             
                mothurOut("by");
index c5afe86a79a9e92c789735ea3b1be3d33accf66a..e3e2ef415fd8f9f4ea5d45e8c0bcd192a06f01f7 100644 (file)
--- a/mothur.h
+++ b/mothur.h
@@ -171,6 +171,16 @@ inline int openOutputFileAppend(string fileName, ofstream& fileHandle){
 }
 /***********************************************************************/
 
+inline void gobble(istream& f){
+       
+       char d;
+    while(isspace(d=f.get()))          {;}
+       f.putback(d);
+       
+}
+
+/***********************************************************************/
+
 inline string getline(ifstream& fileHandle) {
        try {
        
@@ -181,7 +191,7 @@ inline string getline(ifstream& fileHandle) {
                        char c = fileHandle.get(); 
                        
                        //are you at the end of the line
-                       if ((c == '\n') || (c == '\r') || (c == '\f')){   break;        }       
+                       if ((c == '\n') || (c == '\r') || (c == '\f')){  break; }       
                        else {          line += c;              }
                }
                
@@ -265,15 +275,6 @@ inline void errorOut(exception& e, string object, string function) {
 
 
 
-/***********************************************************************/
-
-inline void gobble(istream& f){
-       
-       char d;
-    while(isspace(d=f.get()))          {;}
-       f.putback(d);
-       
-}
 /***********************************************************************/
 
 inline bool isTrue(string f){
index 41c38e86899f35d0dfc93e6f54a6f63b6f845254..5584b9b0ee5200569a9eb8021ef7a3ef8ac664c1 100644 (file)
@@ -244,7 +244,7 @@ int RareFactCommand::execute(){
                
                //run last line if you need to
                if (needToRun == true)  {
-                       delete order;
+                       if (order != NULL) {    delete order;   }
                        order = (input->getOrderVector(lastLabel));
                                
                        rCurve = new Rarefact(order, rDisplays);
index 79bf7bb113ddd682849421f577c80fee3baff082..7e1b4773ddb0505861fd90a2c0064b37ce5e9c59 100644 (file)
@@ -239,7 +239,7 @@ int RareFactSharedCommand::execute(){
                
                //run last line if you need to
                if (needToRun == true)  {
-                       for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
+                       for (int i = 0; i < lookup.size(); i++) {  if (lookup[i] != NULL) {     delete lookup[i]; }  } 
                        lookup = input->getSharedRAbundVectors(lastLabel);
 
                        mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
index 579f848bdb75b10b1350d1eb61b589de8f543ee0..263d57ba0e205d186b634d18a10bd4c72d4bbe8e 100644 (file)
@@ -152,7 +152,7 @@ int ReadDistCommand::execute(){
                
                if (abort == true) {    return 0;       }
 
-               time_t start = time(NULL);
+               //time_t start = time(NULL);
                size_t numDists = 0;
                
                if (format == "matrix") {
@@ -192,15 +192,15 @@ int ReadDistCommand::execute(){
         }
                        }
 
-      string dist_string = "Dist:";
-      string count_string = "Count: ";
-                       for (int i = 0; i <= lines;i++) {       
-       dist_string = dist_string.append("\t").append(toString(dist_cutoff[i]));
-       count_string = count_string.append("\t").append(toString(dist_count[i]));
-                       }
-      mothurOut(dist_string); mothurOutEndLine(); mothurOut(count_string); mothurOutEndLine();
+     // string dist_string = "Dist:";
+    //  string count_string = "Count: ";
+                       //for (int i = 0; i <= lines;i++) {     
+       //dist_string = dist_string.append("\t").append(toString(dist_cutoff[i]));
+      //       count_string = count_string.append("\t").append(toString(dist_count[i]));
+               //      }
+      //mothurOut(dist_string); mothurOutEndLine(); mothurOut(count_string); mothurOutEndLine();
                }
-               mothurOut("It took " + toString(time(NULL) - start) + " secs to read " + toString(numDists) + " distances (cutoff: " + toString(cutoff) + ")"); mothurOutEndLine();
+               //mothurOut("It took " + toString(time(NULL) - start) + " secs to read " + toString(numDists) + " distances (cutoff: " + toString(cutoff) + ")"); mothurOutEndLine();
                return 0;
                
        }
index c49e56ac8d9264f535a7b9c6f7457948f421f69a..4b35138998b13bfe181c743bdfd50e4f64f60752 100644 (file)
@@ -119,7 +119,7 @@ int SharedCommand::execute(){
                
                //run last line if you need to
                if (needToRun == true)  {
-                       delete SharedList;
+                       if (SharedList != NULL) {       delete SharedList;      }
                        SharedList = input->getSharedListVector(lastLabel); //get new list vector to process
                                        
                        lookup = SharedList->getSharedRAbundVector();
index 6ef1faeef4147bdedbaaa31f14076c8a078a1622..731a4101eaff0b6b5712caf15bf7a0ad6feb6e62 100644 (file)
@@ -290,7 +290,7 @@ int SummaryCommand::execute(){
                
                //run last line if you need to
                if (needToRun == true)  {
-                       delete sabund;
+                       if (sabund != NULL) {   delete sabund;  }
                        sabund = input->getSAbundVector(lastLabel);
                        
                        mothurOut(sabund->getLabel()); mothurOutEndLine();
index 74327ba684a535d0dd62125a5848e159bf6ddcc9..9f951debfddf4346ed362dffa529d03e4bce3350 100644 (file)
@@ -318,7 +318,7 @@ int SummarySharedCommand::execute(){
                
                //run last line if you need to
                if (needToRun == true)  {
-                               for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
+                               for (int i = 0; i < lookup.size(); i++) {  if (lookup[i] != NULL) {     delete lookup[i];       } } 
                                lookup = input->getSharedRAbundVectors(lastLabel);
 
                                mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
index ab81f42a08d80dfebb8cb7f784623bbd3e421100..27f701ffd20da0ea1d83a011b575a5d9fb5ea956 100644 (file)
@@ -490,7 +490,7 @@ void TreeGroupCommand::makeSimsShared() {
                
                //run last line if you need to
                if (needToRun == true)  {
-                       for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
+                       for (int i = 0; i < lookup.size(); i++) {  if (lookup[i] != NULL) {             delete lookup[i]; }             } 
                        lookup = input->getSharedRAbundVectors(lastLabel);
 
                        mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
index 9ea78baf17370d7c068e40d56014f2f4f6d49010..5f55deea98379b5813bed720fe9fad3bd76ac23f 100644 (file)
@@ -24,7 +24,7 @@ class UnifracWeightedCommand : public Command {
        
        public:
                UnifracWeightedCommand(string); 
-               ~UnifracWeightedCommand() { delete weighted; delete util; }
+               ~UnifracWeightedCommand() { if (abort == false) {  delete weighted; delete util; } }
                int execute();  
                void help();
        
index 84d33f226c760a100b05d38f6cdf89cb8c041112..f28800191f908ec7feabd8271228583b61c3b6a8 100644 (file)
@@ -275,7 +275,7 @@ int VennCommand::execute(){
                
                        //run last line if you need to
                        if (needToRun == true)  {
-                                       for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  } 
+                                       for (int i = 0; i < lookup.size(); i++) {  if (lookup[i] != NULL) {     delete lookup[i]; }  } 
                                        lookup = input->getSharedRAbundVectors(lastLabel);
 
                                        mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
@@ -341,7 +341,7 @@ int VennCommand::execute(){
                
                        //run last line if you need to
                        if (needToRun == true)  {
-                               delete sabund;
+                               if (sabund != NULL) {   delete sabund;  }
                                sabund = input->getSAbundVector(lastLabel);
                                        
                                mothurOut(sabund->getLabel()); mothurOutEndLine();