#include "readotucommand.h"
+//**********************************************************************************************************************
+vector<string> ReadOtuCommand::getValidParameters(){
+ try {
+ string Array[] = {"list","order","shared","relabund","label","group","sabund", "rabund","groups","ordergroup","outputdir","inputdir"};
+ vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ReadOtuCommand", "getValidParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+ReadOtuCommand::ReadOtuCommand(){
+ try {
+ abort = true; calledHelp = true;
+ vector<string> tempOutNames;
+ outputTypes["rabund"] = tempOutNames;
+ outputTypes["shared"] = tempOutNames;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ReadOtuCommand", "ReadOtuCommand");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+vector<string> ReadOtuCommand::getRequiredParameters(){
+ try {
+ string Array[] = {"list","shared","relabund","sabund","rabund","or"};
+ vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ChopSeqsCommand", "getRequiredParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+vector<string> ReadOtuCommand::getRequiredFiles(){
+ try {
+ vector<string> myArray;
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ReadOtuCommand", "getRequiredFiles");
+ exit(1);
+ }
+}
//**********************************************************************************************************************
ReadOtuCommand::ReadOtuCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
//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
for (it = parameters.begin(); it != parameters.end(); it++) {
if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; }
}
-
+
+ //initialize outputTypes
+ vector<string> tempOutNames;
+ outputTypes["rabund"] = tempOutNames;
+ outputTypes["shared"] = tempOutNames;
+
globaldata->newRead();
//if the user changes the input directory command factory will send this info to us in the output parameter
int ReadOtuCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
if (globaldata->getFormat() == "shared") {
//m->mothurOutEndLine();
}
+ outputTypes = shared->getOutputFiles();
+
delete shared;
}
return 0;