]> git.donarmstrong.com Git - mothur.git/blobdiff - seqsummarycommand.cpp
added load.logfile command. changed summary.single output for subsample=t.
[mothur.git] / seqsummarycommand.cpp
index 1ea58c584054b9b4b5944db18d198fd49e78cc51..c328a041267d01e21ed2e99780f18de486571685 100644 (file)
@@ -45,6 +45,26 @@ string SeqSummaryCommand::getHelpString(){
                exit(1);
        }
 }
+//**********************************************************************************************************************
+string SeqSummaryCommand::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 == "summary")            {   outputFileName =  "summary";   }
+            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, "SeqSummaryCommand", "getOutputFileNameTag");
+               exit(1);
+       }
+}
 
 //**********************************************************************************************************************
 SeqSummaryCommand::SeqSummaryCommand(){        
@@ -155,7 +175,7 @@ int SeqSummaryCommand::execute(){
                //set current fasta to fastafile
                m->setFastaFile(fastafile);
                
-               string summaryFile = outputDir + m->getSimpleName(fastafile) + ".summary";
+               string summaryFile = outputDir + m->getRootName(m->getSimpleName(fastafile)) + getOutputFileNameTag("summary");
                                
                int numSeqs = 0;