validCommand = new ValidCommands();
validParameter = new ValidParameters();
validCalculator = new ValidCalculators();
+}
+/*******************************************************/
+
+/******************************************************/
+
+void ErrorCheck::refresh() {
columnfile = globaldata->getColumnFile();
phylipfile = globaldata->getPhylipFile();
listfile = globaldata->getListFile();
cutoff = globaldata->getCutOff();
format = globaldata->getFormat();
method = globaldata->getMethod();
-
+ randomtree = globaldata->getRandomTree();
}
+
/*******************************************************/
/******************************************************/
bool ErrorCheck::checkInput(string input) {
errorFree = true;
clear();
-
+
+ //refresh variable
+ refresh();
+
//get command name and parameters
int openParen = input.find_first_of('(');
int closeParen = input.find_last_of(')');
if (parameter == "fileroot" ) { fileroot = value; }
if (parameter == "line" ) { line = value; }
if (parameter == "label" ) { label = value; }
+ if (parameter == "randomtree" ) { randomtree = value; }
if (parameter == "single") {//stores estimators in a vector
singleEsimators.clear(); //clears out old values
if (parameter == "fileroot" ) { fileroot = value; }
if (parameter == "line" ) { line = value; }
if (parameter == "label" ) { label = value; }
+ if (parameter == "randomtree" ) { randomtree = value; }
if (parameter == "single") {//stores estimators in a vector
singleEsimators.clear(); //clears out old values
errorFree = false;
}
+ if (commandName == "parsimony") {
+ //are you trying to use parsimony without reading a tree or saying you want random distribution
+ if (randomtree == "0") {
+ if ((globaldata->getTreeFile() == "") || (globaldata->getGroupFile() == "")) {
+ cout << "You must read a treefile and a groupfile or set the randomtree parameter to 1, before you may execute the parsimony command." << endl; return false; }
+ }
+ }
+
//check for valid method
if (commandName == "cluster") {
if ((method == "furthest") || (method == "nearest") || (method == "average")) { }