*/
#include "errorchecking.h"
-#include <math.h>
/*******************************************************/
cutoff = globaldata->getCutOff();
format = globaldata->getFormat();
method = globaldata->getMethod();
+ randomtree = globaldata->getRandomTree();
+ sharedfile = globaldata->getSharedFile();
+
- string p[] = {
+/* string p[] = {
"phylip", //0
"column", //1
"list", //2
"summary", //22
"sharedrarefaction", //23
"sharedsummary", //24
- "comparegroups", //25
+ "groups", //25
"abund", //26
};
intParams[p[13]] = ipv2;
intParams[p[14]] = ipv3;
intParams[p[17]] = ipv4;
- intParams[p[26]] = ipv5;
+ intParams[p[26]] = ipv5; */
- randomtree = globaldata->getRandomTree();
- sharedfile = globaldata->getSharedFile();
}
/*******************************************************/
//is it a valid parameter
if (validParameter->isValidParameter(parameter) != true) { return false; }
- if(!validCommandParameter(parameter,commandName)) {
- cout << "'" << parameter << "' is not a valid parameter for the " << commandName << " command.\n";
- return false;
- }
- if(!validParameterValue(value, parameter)) {
- if(parameter.compare("precision") == 0)
- cout << "The precision parameter can only take powers of 10 as a value (e.g. 10,1000,1000, etc.)\n";
- else {
- vector<double> bounds = intParams[parameter];
+ //if(!validCommandParameter(parameter,commandName)) {
+ // cout << "'" << parameter << "' is not a valid parameter for the " << commandName << " command.\n";
+ // return false;
+ //}
+ //if(!validParameterValue(value, parameter)) {
+ // if(parameter.compare("precision") == 0)
+ // cout << "The precision parameter can only take powers of 10 as a value (e.g. 10,1000,1000, etc.)\n";
+ // else {
+ /* vector<double> bounds = intParams[parameter];
double a = bounds.at(0);
double b = bounds.at(1);
double c = bounds.at(2);
}
}
return false;
- }
+ } */
if (parameter == "phylip" ) { phylipfile = value; }
if (parameter == "column" ) { columnfile = value; }
if (parameter == "label" ) { label = value; }
if (parameter == "abund" ) { abund = value; }
if (parameter == "random" ) { randomtree = value; }
-
- if (parameter == "comparegroups") { //stores groups to be compared
- sharedGroups.clear(); //clears out old values
- globaldata->splitAtDash(value, sharedGroups);
- }
-
}
//gets the last parameter and value
splitAtEquals(parameter, value);
//is it a valid parameter
if (validParameter->isValidParameter(parameter) != true) { return false; }
- if(!validCommandParameter(parameter,commandName)) {
- cout << "'" << parameter << "' is not a valid parameter for the " << commandName << " command.\n";
- return false;
- }
- if(!validParameterValue(value, parameter)) {
+ // if(!validCommandParameter(parameter,commandName)) {
+ // cout << "'" << parameter << "' is not a valid parameter for the " << commandName << " command.\n";
+ // return false;
+ // }
+ /* if(!validParameterValue(value, parameter)) {
if(parameter.compare("precision") == 0)
cout << "The precision parameter can only take powers of 10 as a value (e.g. 10,1000,1000, etc.)\n";
else {
}
}
return false;
- }
+ }*/
if (parameter == "phylip" ) { phylipfile = value; }
if (parameter == "column" ) { columnfile = value; }
if (parameter == "list" ) { listfile = value; }
if (parameter == "label" ) { label = value; }
if (parameter == "random" ) { randomtree = value; }
if (parameter == "abund" ) { abund = value; }
-
- if (parameter == "comparegroups") { //stores groups to be compared
- sharedGroups.clear(); //clears out old values
- globaldata->splitAtDash(value, sharedGroups);
- }
}
}
//you want to do shared commands
if ((listfile != "") && (groupfile != "")) {
validateParseFiles(); //checks the listfile and groupfile parameters
- }else { //you want to do single commands
+ }else if (listfile != "") { //you want to do single commands
validateReadFiles();
validateReadPhil();
+ }else {//you are reading a shared file
+ validateReadFiles();
}
- }else if (commandName == "read.shared") {
- //you want to do shared commands with just the shared file
- validateReadFiles();
}else if (commandName == "read.tree") {
validateTreeFiles(); //checks the treefile and groupfile parameters
}else if (commandName == "deconvolute") {
}
//are you trying to cluster before you have read something
- if ((commandName == "cluster") && (globaldata->getSparseMatrix() == NULL) ||
- (commandName == "cluster") && (globaldata->getListVector() == NULL)) {
+ if (((commandName == "cluster") && (globaldata->gSparseMatrix == NULL)) ||
+ ((commandName == "cluster") && (globaldata->gListVector == NULL))) {
cout << "Before you use the cluster command, you first need to read in a distance matrix." << endl;
errorFree = false;
}
}
}
- globaldata->clearAbund();
-
return errorFree;
}
}
/*******************************************************/
-/******************************************************/
+/******************************************************
//This function checks to see if the given paramter
//is a valid paramter for the given command.
bool ErrorCheck::validCommandParameter(string parameter, string commandName) {
}
/*******************************************************/
-/******************************************************/
+/******************************************************
//This function checks to see if the given paramter value
//is convertable into an int if that parameter requires it.
bool ErrorCheck::validParameterValue(string value, string parameter) {