]> git.donarmstrong.com Git - mothur.git/blobdiff - readdistcommand.cpp
modified seqerror and qualscores
[mothur.git] / readdistcommand.cpp
index 0445eec63328e2cf7a646f1cc662bb36fdd3bb98..630f6493fef9b542dfd8fea434f935987b6ac98f 100644 (file)
 #include "readcolumn.h"
 #include "readmatrix.hpp"
 
+//**********************************************************************************************************************
+vector<string> ReadDistCommand::getValidParameters(){  
+       try {
+               string Array[] =  {"phylip", "column", "name", "cutoff", "precision", "group","outputdir","inputdir","sim"};
+               vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "ReadDistCommand", "getValidParameters");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+vector<string> ReadDistCommand::getRequiredParameters(){       
+       try {
+               string Array[] =  {"phylip","column","or"};
+               vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "ReadDistCommand", "getRequiredParameters");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+vector<string> ReadDistCommand::getRequiredFiles(){    
+       try {
+               vector<string> myArray;
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "ReadDistCommand", "getRequiredFiles");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
 ReadDistCommand::ReadDistCommand(string option) {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                
                //allow user to run help
-               if(option == "help") { help(); abort = true; }
+               if(option == "help") { help(); abort = true; calledHelp = true; }
                
                else {
                        //valid paramters for this command
@@ -203,13 +239,11 @@ ReadDistCommand::~ReadDistCommand(){
 int ReadDistCommand::execute(){
        try {
                
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
 
                time_t start = time(NULL);
                size_t numDists = 0;
                
-               vector<string> outputNames;
-               
                if (format == "matrix") {
                        ifstream in;
                        m->openInputFile(distFileName, in);