]> git.donarmstrong.com Git - mothur.git/blobdiff - readotu.cpp
fixed some bugs
[mothur.git] / readotu.cpp
index 455641a8f52b7cb24c0b5e74d19ff83c27ed6667..b97c902d7712e957ea44819d24cd7af0ae22cd4a 100644 (file)
 
 ReadOTUFile::ReadOTUFile(string pf): philFile(pf){
        
-       openInputFile(philFile, fileHandle);
+       //openInputFile(philFile, fileHandle);
 }
 
 /***********************************************************************/
 //This function reads the list, rabund or sabund files to be used by collect and rarefact command.
 void ReadOTUFile::read(GlobalData* globaldata){
        try {
+
                if (globaldata->getOrderFile() == "") {
                        //you have two inputs because in the next if statement if you only have one then it moves ahead in the same file.  
                        //So when you run the collect or summary commands you miss a line.
@@ -30,22 +31,26 @@ void ReadOTUFile::read(GlobalData* globaldata){
                }else {//there is an orderfile
                        input = new InputData(philFile, globaldata->getOrderFile(), globaldata->getFormat());
                }
-               
+//cout << "made it here"       << endl;        
                //memory leak prevention
                //if (globaldata->ginput != NULL) { delete globaldata->ginput;  }
                globaldata->ginput = input;     //saving to be used by collector and rarefact commands.
-               
+//cout << "after input" << endl;               
                if ((globaldata->getFormat() == "list") || (globaldata->getFormat() == "rabund") || (globaldata->getFormat() == "sabund")) {//you are reading a list, rabund or sabund file for collect, rarefaction or summary.
                        order = input->getOrderVector();
                        //memory leak prevention
                        //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.
                        rabund = inputRabund->getRAbundVector(); 
+                       //if (globaldata->rabund != NULL) { delete globaldata->rabund;  }
                        globaldata->rabund = rabund; //saving to be used by heatmap.bin command.
                        list = inputList->getListVector();
+                       //if (globaldata->gListVector != NULL) { delete globaldata->gListVector;  }
                        globaldata->gListVector = list;
+
                }else if (globaldata->getFormat() == "shared") {
                        SharedList = input->getSharedListVector(); //you are reading for collect.shared, rarefaction.shared, summary.shared, parselist command, or shared commands.
                        //memory leak prevention