X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=errorchecking.cpp;h=ff94c8f4f765a8e0041604416e3b6807b423c05a;hb=d97b619c4297b1274c754d73a64792ba656b0a79;hp=cc6cbf9d8d96ac90a55dc68d16d2ffa157079cb1;hpb=addc715b6d7ea52440751cec10edad03e1a19b37;p=mothur.git diff --git a/errorchecking.cpp b/errorchecking.cpp index cc6cbf9..ff94c8f 100644 --- a/errorchecking.cpp +++ b/errorchecking.cpp @@ -8,7 +8,6 @@ */ #include "errorchecking.h" -#include /*******************************************************/ @@ -37,9 +36,12 @@ void ErrorCheck::refresh() { 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 @@ -65,7 +67,7 @@ void ErrorCheck::refresh() { "summary", //22 "sharedrarefaction", //23 "sharedsummary", //24 - "comparegroups", //25 + "groups", //25 "abund", //26 }; @@ -156,10 +158,8 @@ void ErrorCheck::refresh() { 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(); } /*******************************************************/ @@ -204,15 +204,15 @@ bool ErrorCheck::checkInput(string input) { //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 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 bounds = intParams[parameter]; double a = bounds.at(0); double b = bounds.at(1); double c = bounds.at(2); @@ -244,7 +244,7 @@ bool ErrorCheck::checkInput(string input) { } } return false; - } + } */ if (parameter == "phylip" ) { phylipfile = value; } if (parameter == "column" ) { columnfile = value; } @@ -268,12 +268,6 @@ bool ErrorCheck::checkInput(string input) { 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 @@ -282,11 +276,11 @@ bool ErrorCheck::checkInput(string input) { 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 { @@ -322,7 +316,7 @@ bool ErrorCheck::checkInput(string input) { } } return false; - } + }*/ if (parameter == "phylip" ) { phylipfile = value; } if (parameter == "column" ) { columnfile = value; } if (parameter == "list" ) { listfile = value; } @@ -345,11 +339,6 @@ bool ErrorCheck::checkInput(string input) { 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); - } } } @@ -420,8 +409,6 @@ bool ErrorCheck::checkInput(string input) { } } - globaldata->clearAbund(); - return errorFree; } @@ -499,7 +486,7 @@ void ErrorCheck::validateReadFiles() { } /*******************************************************/ -/******************************************************/ +/****************************************************** //This function checks to see if the given paramter //is a valid paramter for the given command. bool ErrorCheck::validCommandParameter(string parameter, string commandName) { @@ -521,7 +508,7 @@ 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) {