#include "solow.h"
#include "shen.h"
+//**********************************************************************************************************************
+vector<string> SummaryCommand::getValidParameters(){
+ try {
+ string Array[] = {"label","calc","abund","size","outputdir","groupmode","inputdir"};
+ vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SummaryCommand", "getValidParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+SummaryCommand::SummaryCommand(){
+ try {
+ abort = true;
+ //initialize outputTypes
+ vector<string> tempOutNames;
+ outputTypes["summary"] = tempOutNames;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SummaryCommand", "SummaryCommand");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+vector<string> SummaryCommand::getRequiredParameters(){
+ try {
+ vector<string> myArray;
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SummaryCommand", "getRequiredParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+vector<string> SummaryCommand::getRequiredFiles(){
+ try {
+ string AlignArray[] = {"shared","list","rabund","sabund","or"};
+ vector<string> myArray (AlignArray, AlignArray+(sizeof(AlignArray)/sizeof(string)));
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SummaryCommand", "getRequiredFiles");
+ exit(1);
+ }
+}
//**********************************************************************************************************************
SummaryCommand::SummaryCommand(string option) {
if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; }
}
+ //initialize outputTypes
+ vector<string> tempOutNames;
+ outputTypes["summary"] = tempOutNames;
+
//make sure the user has already run the read.otu command
if ((globaldata->getSharedFile() == "") && (globaldata->getListFile() == "") && (globaldata->getRabundFile() == "") && (globaldata->getSabundFile() == "")) { m->mothurOut("You must read a list, sabund, rabund or shared file before you can use the summary.single command."); m->mothurOutEndLine(); abort = true; }
if (abort == true) { return 0; }
- vector<string> outputNames;
-
string hadShared = "";
if ((globaldata->getFormat() != "sharedfile")) { inputFileNames.push_back(globaldata->inputFileName); }
else { hadShared = globaldata->getSharedFile(); inputFileNames = parseSharedFile(globaldata->getSharedFile()); globaldata->setFormat("rabund"); }
string fileNameRoot = outputDir + m->getRootName(m->getSimpleName(inputFileNames[p])) + "summary";
globaldata->inputFileName = inputFileNames[p];
- outputNames.push_back(fileNameRoot);
+ outputNames.push_back(fileNameRoot); outputTypes["summary"].push_back(fileNameRoot);
if (inputFileNames.size() > 1) {
m->mothurOutEndLine(); m->mothurOut("Processing group " + groups[p]); m->mothurOutEndLine(); m->mothurOutEndLine();