]> git.donarmstrong.com Git - mothur.git/commitdiff
minor error checking fixes
authorwestcott <westcott>
Fri, 13 Feb 2009 17:29:04 +0000 (17:29 +0000)
committerwestcott <westcott>
Fri, 13 Feb 2009 17:29:04 +0000 (17:29 +0000)
errorchecking.cpp
globaldata.cpp

index 8556c27266ab0c2fa56bd4c9ddeb644e1d81e0b8..7f581d9e91fd4ef1352e866180f36a4aefccc69f 100644 (file)
@@ -140,7 +140,9 @@ bool ErrorCheck::checkInput(string input) {
                
                //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; }
-       
+               
+               //make sure you have a valid random tree value
+               if ((randomtree != "0") && (randomtree != "1")) { cout << randomtree << " is not a valid randomtree value.  Valid values for randomtree are 0, (meaning you have read your own trees) or 1 (meaning you want to random distribution of trees)." << endl; return false; }
                
                if (commandName == "read.dist") { 
                        validateReadFiles();
@@ -173,7 +175,7 @@ bool ErrorCheck::checkInput(string input) {
                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() == "")) {
+                               if (globaldata->gTree.size() == 0) {
                                        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;  }
                        }
                }
index 0348ae6bca626342104591d945ff8acd951d835b..9b740a68c1a6b945d4f12789a5ee125e308f2c8c 100644 (file)
@@ -74,6 +74,7 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                if ((commandName == "read.dist") || (commandName == "read.otu") || (commandName == "read.tree") || (commandName == "read.shared")) { 
                        clear();
                        gGroupmap = NULL;
+                       gTree.clear();
                }
                
                //saves help request