]> git.donarmstrong.com Git - mothur.git/blobdiff - readotu.cpp
added remove.seqs command
[mothur.git] / readotu.cpp
index 09a6c4cd00f58d5fc09424972c3f6ae93c88542d..d16dab9477d4c02ce89ad42de0be4c46228588b4 100644 (file)
@@ -13,7 +13,7 @@
 
 ReadOTUFile::ReadOTUFile(string pf): philFile(pf){
        
-       openInputFile(philFile, fileHandle);
+       //openInputFile(philFile, fileHandle);
 }
 
 /***********************************************************************/
@@ -31,7 +31,7 @@ void ReadOTUFile::read(GlobalData* globaldata){
                }else {//there is an orderfile
                        input = new InputData(philFile, globaldata->getOrderFile(), globaldata->getFormat());
                }
-               
+       
                //memory leak prevention
                //if (globaldata->ginput != NULL) { delete globaldata->ginput;  }
                globaldata->ginput = input;     //saving to be used by collector and rarefact commands.
@@ -42,11 +42,17 @@ void ReadOTUFile::read(GlobalData* globaldata){
                        //if (globaldata->gorder != NULL) { delete globaldata->gorder;  }
                        globaldata->gorder = order;     //saving to be used by collect and rarefact commands.
                        sabund = inputSabund->getSAbundVector(); 
+                       //if (globaldata->sabund != NULL) { delete globaldata->sabund;  }
                        globaldata->sabund = sabund; //saving to be used by summary command.
+                       delete inputSabund;
                        rabund = inputRabund->getRAbundVector(); 
+                       //if (globaldata->rabund != NULL) { delete globaldata->rabund;  }
                        globaldata->rabund = rabund; //saving to be used by heatmap.bin command.
+                       delete inputRabund;
                        list = inputList->getListVector();
+                       //if (globaldata->gListVector != NULL) { delete globaldata->gListVector;  }
                        globaldata->gListVector = list;
+                       delete inputList;
 
                }else if (globaldata->getFormat() == "shared") {
                        SharedList = input->getSharedListVector(); //you are reading for collect.shared, rarefaction.shared, summary.shared, parselist command, or shared commands.
@@ -56,11 +62,7 @@ void ReadOTUFile::read(GlobalData* globaldata){
                }
        }
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the ReadOTUFile class Function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }
-       catch(...) {
-               cout << "An unknown error has occurred in the ReadOTUFile class function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               errorOut(e, "ReadOTUFile", "read");
                exit(1);
        }
 }