]> git.donarmstrong.com Git - mothur.git/blobdiff - getsabundcommand.cpp
added load.logfile command. changed summary.single output for subsample=t.
[mothur.git] / getsabundcommand.cpp
index 4ae2eaa004f9df9cc75c12b63626ffa7fad71ea7..5425c41a917f4b02d67c5b4dfcb63e1b2fc6159b 100644 (file)
@@ -45,7 +45,26 @@ string GetSAbundCommand::getHelpString(){
                exit(1);
        }
 }
-
+//**********************************************************************************************************************
+string GetSAbundCommand::getOutputFileNameTag(string type, string inputName=""){       
+       try {
+        string outputFileName = "";
+               map<string, vector<string> >::iterator it;
+        
+        //is this a type this command creates
+        it = outputTypes.find(type);
+        if (it == outputTypes.end()) {  m->mothurOut("[ERROR]: this command doesn't create a " + type + " output file.\n"); }
+        else {
+            if (type == "sabund")            {   outputFileName = "sabund";  }
+            else { m->mothurOut("[ERROR]: No definition for type " + type + " output file tag.\n"); m->control_pressed = true;  }
+        }
+        return outputFileName;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "GetSAbundCommand", "getOutputFileNameTag");
+               exit(1);
+       }
+}
 //**********************************************************************************************************************
 GetSAbundCommand::GetSAbundCommand(){  
        try {
@@ -166,7 +185,7 @@ int GetSAbundCommand::execute(){
        try {
                
                if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
-               filename = outputDir + m->getRootName(m->getSimpleName(inputfile)) + "sabund";
+               filename = outputDir + m->getRootName(m->getSimpleName(inputfile)) + getOutputFileNameTag("sabund");
                m->openOutputFile(filename, out);
                
                input = new InputData(inputfile, format);