X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=readotu.cpp;h=00448f8a24cced84a346dfedc434ffa838698371;hb=134a9c1275862a6b3ea10a2c0f11965c0a535854;hp=d16dab9477d4c02ce89ad42de0be4c46228588b4;hpb=510b1cfc25cd79391d6973ca20c5ec25fb1bb3b2;p=mothur.git diff --git a/readotu.cpp b/readotu.cpp index d16dab9..00448f8 100644 --- a/readotu.cpp +++ b/readotu.cpp @@ -12,8 +12,8 @@ /***********************************************************************/ ReadOTUFile::ReadOTUFile(string pf): philFile(pf){ - - //openInputFile(philFile, fileHandle); + m = MothurOut::getInstance(); + //m->openInputFile(philFile, fileHandle); } /***********************************************************************/ @@ -35,20 +35,25 @@ void ReadOTUFile::read(GlobalData* globaldata){ //memory leak prevention //if (globaldata->ginput != NULL) { delete globaldata->ginput; } globaldata->ginput = input; //saving to be used by collector and rarefact commands. - + if ((globaldata->getFormat() == "list") || (globaldata->getFormat() == "rabund") || (globaldata->getFormat() == "sabund")) {//you are reading a list, rabund or sabund file for collect, rarefaction or summary. + +//cout << input << '\t' << globaldata << endl; 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. 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; @@ -59,10 +64,13 @@ void ReadOTUFile::read(GlobalData* globaldata){ //memory leak prevention //if (globaldata->gSharedList != NULL) { delete globaldata->gSharedList; } globaldata->gSharedList = SharedList; + delete inputSabund; + delete inputRabund; + delete inputList; } } catch(exception& e) { - errorOut(e, "ReadOTUFile", "read"); + m->errorOut(e, "ReadOTUFile", "read"); exit(1); } }