]> git.donarmstrong.com Git - mothur.git/blobdiff - errorchecking.cpp
added errorchecking and help info on new unifrac and treeclimber code
[mothur.git] / errorchecking.cpp
index 03844d5fa5b132e21ad1ae60e1c9e7b43e343aa2..067d246d4c50f1427840c3879be04bac2ff7cdf8 100644 (file)
@@ -90,7 +90,7 @@ bool ErrorCheck::checkInput(string input) {
                                if (parameter == "name" )               { namefile = value; }
                                if (parameter == "order" )              { orderfile = value; }
                                if (parameter == "fasta" )              { fastafile = value; }
-                               if (parameter == "treefile" )           { treefile = value; }
+                               if (parameter == "tree" )               { treefile = value; }
                                if (parameter == "group" )              { groupfile = value; }
                                if (parameter == "cutoff" )                     { cutoff = value; }
                                if (parameter == "precision" )          { precision = value; }
@@ -161,7 +161,7 @@ bool ErrorCheck::checkInput(string input) {
                                if (parameter == "order" )              { orderfile = value; }
                                if (parameter == "group" )              { groupfile = value; }
                                if (parameter == "fasta" )              { fastafile = value; }
-                               if (parameter == "treefile" )           { treefile = value; }
+                               if (parameter == "tree" )               { treefile = value; }
                                if (parameter == "cutoff" )                     { cutoff = value; }
                                if (parameter == "precision" )          { precision = value; }
                                if (parameter == "iters" )                      { iters = value; }
@@ -254,6 +254,11 @@ bool ErrorCheck::checkInput(string input) {
                        }
                }
                
+               if ((commandName == "unifrac.weighted") || (commandName == "unifrac.unweighted")) {
+                       if (globaldata->gTree.size() == 0) {//no trees were read
+                               cout << "You must execute the read.tree command, before you may execute the unifrac.weighted or unifrac.unweighted command." << endl; return false;  }
+               }
+               
                //check for valid method
                if (commandName == "cluster") {
                        if ((method == "furthest") || (method == "nearest") || (method == "average")) { }