input = globaldata->ginput;
list = globaldata->gListVector;
- ListVector* lastList = list;
+ string lastLabel = list->getLabel();
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
userLines.erase(count);
}
- if ((anyLabelsToProcess(list->getLabel(), userLabels, "") == true) && (processedLabels.count(lastList->getLabel()) != 1)) {
- cout << lastList->getLabel() << '\t' << count << endl;
+ if ((anyLabelsToProcess(list->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
+ delete list;
+ list = input->getListVector(lastLabel);
+
+ cout << list->getLabel() << '\t' << count << endl;
rabund = new RAbundVector();
- *rabund = (lastList->getRAbundVector());
+ *rabund = (list->getRAbundVector());
rabund->print(out);
delete rabund;
- processedLabels.insert(lastList->getLabel());
- userLabels.erase(lastList->getLabel());
+ processedLabels.insert(list->getLabel());
+ userLabels.erase(list->getLabel());
}
- if (count != 1) { delete lastList; }
- lastList = list;
+ lastLabel = list->getLabel();
+ delete list;
list = input->getListVector();
count++;
}
bool needToRun = false;
for (it = userLabels.begin(); it != userLabels.end(); it++) {
cout << "Your file does not include the label "<< *it;
- if (processedLabels.count(lastList->getLabel()) != 1) {
- cout << ". I will use " << lastList->getLabel() << "." << endl;
+ if (processedLabels.count(lastLabel) != 1) {
+ cout << ". I will use " << lastLabel << "." << endl;
needToRun = true;
}else {
- cout << ". Please refer to " << lastList->getLabel() << "." << endl;
+ cout << ". Please refer to " << lastLabel << "." << endl;
}
}
//run last line if you need to
if (needToRun == true) {
- cout << lastList->getLabel() << '\t' << count << endl;
+ delete list;
+ list = input->getListVector(lastLabel);
+
+ cout << list->getLabel() << '\t' << count << endl;
rabund = new RAbundVector();
- *rabund = (lastList->getRAbundVector());
+ *rabund = (list->getRAbundVector());
rabund->print(out);
delete rabund;
+ delete list;
}
- delete lastList;
out.close();
return 0;