]> git.donarmstrong.com Git - mothur.git/blobdiff - parselistscommand.cpp
added load.logfile command. changed summary.single output for subsample=t.
[mothur.git] / parselistscommand.cpp
index bb096d8646873f74c42bd8970b9eef9693a3252e..4e61a58d9e5cb4bc640c544797c87a363580575e 100644 (file)
@@ -45,6 +45,27 @@ string ParseListCommand::getHelpString(){
                exit(1);
        }
 }
+//**********************************************************************************************************************
+string ParseListCommand::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 == "list") {  outputFileName =  "list"; }
+            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, "ParseListCommand", "getOutputFileNameTag");
+               exit(1);
+       }
+}
+
 //**********************************************************************************************************************
 ParseListCommand::ParseListCommand(){  
        try {
@@ -180,7 +201,7 @@ int ParseListCommand::execute(){
                        temp = new ofstream;
                        filehandles[gGroups[i]] = temp;
                        
-                       string filename = fileroot +  gGroups[i] + ".list";
+                       string filename = fileroot +  gGroups[i] + "." + getOutputFileNameTag("list");
                        outputNames.push_back(filename); outputTypes["list"].push_back(filename);
                        m->openOutputFile(filename, *temp);
                }