X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=readotu.cpp;h=286a2be271a4a7bb2225a71c7081b1a5c8eb4571;hb=753dc84cf289b1d5dc0ca5b0c043640927aa951a;hp=0bcfd320cade47901ac89cbf9e86c7b8ad142b29;hpb=154e089bcd37c2c2f773e53ffb88a20170b27037;p=mothur.git diff --git a/readotu.cpp b/readotu.cpp index 0bcfd32..286a2be 100644 --- a/readotu.cpp +++ b/readotu.cpp @@ -20,29 +20,37 @@ ReadOTUFile::ReadOTUFile(string pf): philFile(pf){ //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. input = new InputData(philFile, globaldata->getFormat()); //format tells you whether philFile is list, rabund, sabund. inputList = new InputData(philFile, globaldata->getFormat()); //format tells you whether philFile is list, rabund, sabund. inputSabund = new InputData(philFile, globaldata->getFormat()); //format tells you whether philFile is list, rabund, sabund or shared. + inputRabund = new InputData(philFile, globaldata->getFormat()); }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