X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=inputdata.cpp;fp=inputdata.cpp;h=dc99a6898ddc57cde2e1442642b766775dc264b2;hb=2bf3df7736ef2a17286d99394e211f51751d6829;hp=5d71450ef60bb0fe5c972d6c38fe67565a5687e7;hpb=b20d7d9b1b0eeeaedb78d8fdf26833fd212d2e81;p=mothur.git diff --git a/inputdata.cpp b/inputdata.cpp index 5d71450..dc99a68 100644 --- a/inputdata.cpp +++ b/inputdata.cpp @@ -16,6 +16,7 @@ InputData::InputData(string fName, string f) : format(f){ m = MothurOut::getInstance(); + globaldata = GlobalData::getInstance(); m->openInputFile(fName, fileHandle); filename = fName; @@ -37,6 +38,7 @@ InputData::~InputData(){ InputData::InputData(string fName, string orderFileName, string f) : format(f){ try { m = MothurOut::getInstance(); + globaldata = GlobalData::getInstance(); ifstream ofHandle; m->openInputFile(orderFileName, ofHandle); string name; @@ -453,7 +455,8 @@ vector InputData::getSharedRAbundVectors(string label){ string thisLabel; m->openInputFile(filename, in); - + globaldata->saveNextLabel = ""; + if(in){ if (format == "sharedfile") { while (in.eof() != true) { @@ -461,6 +464,7 @@ vector InputData::getSharedRAbundVectors(string label){ SharedRAbundVector* SharedRAbund = new SharedRAbundVector(in); if (SharedRAbund != NULL) { thisLabel = SharedRAbund->getLabel(); + //if you are at the last label if (thisLabel == label) { in.close(); return SharedRAbund->getSharedRAbundVectors(); } else { @@ -536,6 +540,7 @@ vector InputData::getSharedRAbundFloatVectors(string l string thisLabel; m->openInputFile(filename, in); + globaldata->saveNextLabel = ""; if(in){ if (format == "sharedfile") {