]> git.donarmstrong.com Git - mothur.git/blobdiff - errorchecking.cpp
added heatmap command
[mothur.git] / errorchecking.cpp
index cb2dce42fbf4f40e4c5e2a5107a6e1d33c1b89c7..59095f76e3bf46c652361e7b270f1c9ca8ebc7a1 100644 (file)
@@ -83,8 +83,10 @@ bool ErrorCheck::checkInput(string input) {
                                splitAtComma(value, optionText);
                                splitAtEquals(parameter, value);
                                
-                               //is it a valid parameter for the command
-                               if (validParameter->isValidParameter(parameter, commandName) != true) { return false; }
+                               //is it a valid parameter
+                               if (validParameter->isValidParameter(parameter, commandName, value) != true) { return false; }
+
+
                                
                                if (parameter == "phylip" )             { phylipfile = value; }
                                if (parameter == "column" )             { columnfile = value; }
@@ -114,9 +116,9 @@ bool ErrorCheck::checkInput(string input) {
                        if (errorFree)  { //gets the last parameter and value
                                value = optionText;
                                splitAtEquals(parameter, value);
-                               
-                               //is it a valid parameter for the command
-                               if (validParameter->isValidParameter(parameter, commandName) != true) { return false; }
+                               //is it a valid parameter
+                               if (validParameter->isValidParameter(parameter, commandName, value) != true) { return false; }
+       
                                
                                if (parameter == "phylip" )             { phylipfile = value; }
                                if (parameter == "column" )             { columnfile = value; }                         
@@ -218,6 +220,12 @@ bool ErrorCheck::checkInput(string input) {
                                else if (globaldata->getGroupFile() == "") { cout << "You must read a list and a group, or a shared before you can use the collect.shared, rarefaction.shared or summary.shared commands." << endl; return false; }
                        }
                }
+               
+               if (commandName == "heatmap"){ 
+                       if ((globaldata->getListFile() == "") && (globaldata->getSharedFile() == "")) {
+                                cout << "You must read a list, or a list and a group, or a shared before you can use the heatmap command." << endl; return false; 
+                       }
+               }
 
                return errorFree;
 }
@@ -436,7 +444,7 @@ void ErrorCheck::validateReadPhil() {
                }else if (sabundfile != "") { 
                        if ((listfile != "") || (rabundfile != "")) { 
                                cout << "When executing a read.otu you must enter ONLY ONE of the following: list, rabund or sabund." << endl; errorFree = false; }
-               }else if ((listfile == "") && (rabundfile == "") && (sabundfile == "")) {
+               }else if ((listfile == "") && (rabundfile == "") && (sabundfile == "") && (sharedfile == "")) {
                            cout << "When executing a read.otu you must enter one of the following: list, rabund or sabund." << endl; errorFree = false; 
                }