/***********************************************************************/
ReadOTUFile::ReadOTUFile(string pf): philFile(pf){
-
+ m = MothurOut::getInstance();
//openInputFile(philFile, fileHandle);
}
}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.
+
+//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;
//memory leak prevention
//if (globaldata->gSharedList != NULL) { delete globaldata->gSharedList; }
globaldata->gSharedList = SharedList;
+ delete inputSabund;
+ delete inputRabund;
+ delete inputList;
}
}
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";
+ m->errorOut(e, "ReadOTUFile", "read");
exit(1);
}
}