X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=errorchecking.cpp;h=19d1f8aeacf25878fee069f1083b0465974d4645;hb=b22853b5cfbf5c47949ad2a084f2fad88b2e4be4;hp=b460987ae401827664d14cdc5645905e0d673d8e;hpb=bdb56fb93c1f0acfb8fa6542ebc444a0701c1f5a;p=mothur.git diff --git a/errorchecking.cpp b/errorchecking.cpp index b460987..19d1f8a 100644 --- a/errorchecking.cpp +++ b/errorchecking.cpp @@ -119,7 +119,6 @@ bool ErrorCheck::checkInput(string input) { if (parameter == "ends" ) { ends = value; } if (parameter == "processors" ) { processors = value; } if (parameter == "size" ) { size = value; } - if (parameter == "template") { templatefile = value; } if (parameter == "search") { search = value; } if (parameter == "ksize") { ksize = value; } @@ -178,7 +177,7 @@ bool ErrorCheck::checkInput(string input) { if (parameter == "mismatch") { mismatch = value; } if (parameter == "gapopen") { gapopen = value; } if (parameter == "gapextend" ) { gapextend = value; } - + } } @@ -278,6 +277,13 @@ bool ErrorCheck::checkInput(string input) { validateBinFiles(); } + if ((commandName == "get.repseqs")) { + if ((globaldata->getListFile() == "")) { cout << "You must read a list file before you can use the get.repseqs command." << endl; return false; } + else if (groupfile == "") { cout << "You must provide a groupfile before you can use the get.repseqs command." << endl; return false; } + validateBinFiles(); + } + + if ((commandName == "get.oturep")) { if ((globaldata->gSparseMatrix == NULL) || (globaldata->gListVector == NULL)) { cout << "Before you use the get.oturep command, you first need to read in a distance matrix." << endl; @@ -609,7 +615,7 @@ void ErrorCheck::validateBinFiles() { int ableToOpen; if (fastafile == "") { - cout << "fasta is a required parameter for bin.seqs and get.oturep commands." << endl; errorFree = false; + cout << "fasta is a required parameter for bin.seqs, get.oturep and get.repseqs commands." << endl; errorFree = false; }else if (fastafile != "") { //is it a valid filename' ableToOpen = openInputFile(fastafile, filehandle); @@ -636,9 +642,17 @@ void ErrorCheck::validateBinFiles() { filehandle.close(); //unable to open if (ableToOpen == 1) { errorFree = false; } + }else if (groupfile != "") { + //is it a valid filename' + ifstream filehandle; + int ableToOpen = openInputFile(groupfile, filehandle); + filehandle.close(); + //unable to open + if (ableToOpen == 1) { errorFree = false; } } + } catch(exception& e) { cout << "Standard Error: " << e.what() << " has occurred in the ErrorCheck class Function validateBinFiles. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";