/******************************************************/
-ErrorCheck::~ErrorCheck() {}
+ErrorCheck::~ErrorCheck() {
+ delete validCommand;
+ delete validParameter;
+}
/*******************************************************/
splitAtEquals(parameter, value);
//is it a valid parameter
- if (validParameter->isValidParameter(parameter, commandName) != true) { return false; }
+ if (validParameter->isValidParameter(parameter, commandName, value) != true) { return false; }
+
+
if (parameter == "phylip" ) { phylipfile = value; }
if (parameter == "column" ) { columnfile = value; }
value = optionText;
splitAtEquals(parameter, value);
//is it a valid parameter
- if (validParameter->isValidParameter(parameter, commandName) != true) { return false; }
+ if (validParameter->isValidParameter(parameter, commandName, value) != true) { return false; }
+
if (parameter == "phylip" ) { phylipfile = value; }
if (parameter == "column" ) { columnfile = value; }
//make sure the user does not use both the line and label parameters
if ((line != "") && (label != "")) { cout << "You may use either the line or label parameters, but not both." << endl; return false; }
+ //check for valid files
if (commandName == "read.dist") {
validateReadFiles();
validateReadDist();
//you want to do shared commands
if ((listfile != "") && (groupfile != "")) {
validateParseFiles(); //checks the listfile and groupfile parameters
- }else if (listfile != "") { //you want to do single commands
+ //you want to do single commands
+ }else if ((listfile != "") || (rabundfile != "") || (sabundfile != "")){
validateReadFiles();
validateReadPhil();
- }else if ((listfile == "") && (sharedfile == "")) {
- cout << "You must enter either a listfile or a sharedfile with the read.otu command. " << endl; return false;
- }else{//you are reading a shared file
+ //you have not given a file
+ }else if ((listfile == "") && (sharedfile == "") && (rabundfile == "") && (sabundfile == "")) {
+ cout << "You must enter either a listfile, rabundfile, sabundfile or a sharedfile with the read.otu command. " << endl; return false;
+ //you want to do shared commands with a shared file
+ }else if (sharedfile != "") {//you are reading a shared file
validateReadFiles();
}
}else if (commandName == "read.tree") {
}
if ((commandName == "libshuff") && ((globaldata->gMatrix == NULL) || (globaldata->gGroupmap == NULL))) {
- cout << "You must read in a matrix and groupfile before you use the libshuff command. " << endl; return false;
+ cout << "You must read in a matrix and groupfile using the read.dist command, before you use the libshuff command. " << endl; return false;
}
if (commandName == "parsimony") {
else if (globaldata->getGroupFile() == "") { cout << "You must read a list and a group, or a shared before you can use the collect.shared, rarefaction.shared or summary.shared commands." << endl; return false; }
}
}
+
+ if (commandName == "heatmap"){
+ if ((globaldata->getListFile() == "") && (globaldata->getSharedFile() == "")) {
+ cout << "You must read a list, or a list and a group, or a shared before you can use the heatmap command." << endl; return false;
+ }
+ }
return errorFree;
}
}else if (sabundfile != "") {
if ((listfile != "") || (rabundfile != "")) {
cout << "When executing a read.otu you must enter ONLY ONE of the following: list, rabund or sabund." << endl; errorFree = false; }
- }else if ((listfile == "") && (rabundfile == "") && (sabundfile == "")) {
+ }else if ((listfile == "") && (rabundfile == "") && (sabundfile == "") && (sharedfile == "")) {
cout << "When executing a read.otu you must enter one of the following: list, rabund or sabund." << endl; errorFree = false;
}