m->mothurOut("You must provide a phylip file."); m->mothurOutEndLine();
abort = true;
}
- }
+ }else { m->setPhylipFile(phylipfile); }
//check for required parameters
groupfile = validParameter.validFile(parameters, "group", true);
m->mothurOut("You must provide a group file."); m->mothurOutEndLine();
abort = true;
}
- }
+ }else { m->setGroupFile(groupfile); }
//if the user changes the output directory command factory will send this info to us in the output parameter
outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){
m->openOutputFile(newGroupFile, outGroups);
for (int i = 0; i < matrix->getNumSeqs(); i++) {
- if (m->control_pressed) { delete groupMap; delete matrix; outGroups.close(); remove(newGroupFile.c_str()); return 0; }
+ if (m->control_pressed) { delete groupMap; delete matrix; outGroups.close(); m->mothurRemove(newGroupFile); return 0; }
Names temp = matrix->getRowInfo(i);
outGroups << temp.seqName << '\t' << temp.groupName << endl;
groupMap = new GroupMap(groupfile);
groupMap->readMap();
- if (m->control_pressed) { delete groupMap; delete matrix; remove(newGroupFile.c_str()); return 0; }
+ if (m->control_pressed) { delete groupMap; delete matrix; m->mothurRemove(newGroupFile); return 0; }
}
setGroups(); //set the groups to be analyzed and sorts them
-
+
+ if (numGroups < 2) { m->mothurOut("[ERROR]: libshuff requires at least 2 groups, you only have " + toString(numGroups) + ", aborting."); m->mothurOutEndLine(); m->control_pressed = true; }
+
+ if (m->control_pressed) { delete groupMap; delete matrix; return 0; }
+
/********************************************************************************************/
//this is needed because when we read the matrix we sort it into groups in alphabetical order
//the rest of the command and the classes used in this command assume specific order
delete matrix; delete groupMap;
- if (m->control_pressed) { outputTypes.clear(); for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
+ if (m->control_pressed) { outputTypes.clear(); for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } return 0; }
m->mothurOutEndLine();
m->mothurOut("Output File Names: "); m->mothurOutEndLine();