- name = binnames + '|' + toString(i+1);
- out << ">" << name << endl;
- out << sequence << endl;
+ //if you don't have groups
+ if (groupfile == "") {
+ binnames = binnames + "|" + toString(i+1);
+ out << ">" << binnames << endl;
+ out << sequence << endl;
+ }else {//if you do have groups
+ string group = groupMap->getGroup(binnames);
+ if (group == "not found") {
+ cout << binnames << " is missing from your group file. Please correct. " << endl;
+ remove(outputFileName.c_str());
+ return 0;
+ }else{
+ binnames = binnames + "|" + group + "|" + toString(i+1);
+ out << ">" << binnames << endl;
+ out << sequence << endl;
+ }
+ }