]> git.donarmstrong.com Git - mothur.git/blobdiff - aligncommand.cpp
added warning about merging with something above cutoff to cluster. working on chimeras
[mothur.git] / aligncommand.cpp
index 784155745fa9c0141d6b2db0ba80133b39e3a85f..708a85472dc53fecec1f022ce86512a82d620c30 100644 (file)
@@ -52,16 +52,20 @@ AlignCommand::AlignCommand(string option){
                        for (it = parameters.begin(); it != parameters.end(); it++) { 
                                if (validParameter.isValidParameter(it->first, myArray, it->second) != true) {  abort = true;  }
                        }
-                       
+
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
                        outputDir = validParameter.validFile(parameters, "outputdir", false);           if (outputDir == "not found"){  outputDir = "";         }
                        
+
                        //if the user changes the input directory command factory will send this info to us in the output parameter 
                        string inputDir = validParameter.validFile(parameters, "inputdir", false);              
+                       
                        if (inputDir == "not found"){   inputDir = "";          }
                        else {
                                string path;
+
                                it = parameters.find("template");
+
                                //user has given a template file
                                if(it != parameters.end()){ 
                                        path = hasPath(it->second);
@@ -69,9 +73,10 @@ AlignCommand::AlignCommand(string option){
                                        if (path == "") {       parameters["template"] = inputDir + it->second;         }
                                }
                        }
-                       
+
                        //check for required parameters
                        templateFileName = validParameter.validFile(parameters, "template", true);
+                       
                        if (templateFileName == "not found") { 
                                mothurOut("template is a required parameter for the align.seqs command."); 
                                mothurOutEndLine();
@@ -106,7 +111,6 @@ AlignCommand::AlignCommand(string option){
                                //make sure there is at least one valid file left
                                if (candidateFileNames.size() == 0) { mothurOut("no valid files."); mothurOutEndLine(); abort = true; }
                        }
-                               
                        
                        //check for optional parameter and set defaults
                        // ...at some point should added some additional type checking...
@@ -214,6 +218,7 @@ int AlignCommand::execute(){
                        string alignFileName = outputDir + getRootName(getSimpleName(candidateFileNames[s])) + "align";
                        string reportFileName = outputDir + getRootName(getSimpleName(candidateFileNames[s])) + "align.report";
                        string accnosFileName = outputDir + getRootName(getSimpleName(candidateFileNames[s])) + "flip.accnos";
+                       bool hasAccnos = true;
                        
                        int numFastaSeqs = 0;
                        for (int i = 0; i < lines.size(); i++) {  delete lines[i];  }  lines.clear();
@@ -303,7 +308,7 @@ int AlignCommand::execute(){
                                                mothurOut(" If you set the flip parameter to true mothur will try aligning the reverse compliment as well."); 
                                        }else{  mothurOut(" If the reverse compliment proved to be better it was reported.");  }
                                        mothurOutEndLine();
-                               }
+                               }else{ hasAccnos = false;  }
                        }
 #else
                        ifstream inFASTA;
@@ -316,7 +321,7 @@ int AlignCommand::execute(){
                        driver(lines[0], alignFileName, reportFileName, accnosFileName, candidateFileNames[s]);
                        
                        //delete accnos file if its blank else report to user
-                       if (isBlank(accnosFileName)) {  remove(accnosFileName.c_str());  }
+                       if (isBlank(accnosFileName)) {  remove(accnosFileName.c_str());  hasAccnos = false; }
                        else { 
                                mothurOut("Some of you sequences generated alignments that eliminated too many bases, a list is provided in " + accnosFileName + ".");
                                if (!flip) {
@@ -327,7 +332,10 @@ int AlignCommand::execute(){
                        
 #endif
                        
-                       
+                       mothurOut("Output File Names: " + alignFileName + ", " + reportFileName);
+                       if (hasAccnos)  {       mothurOut(", " + accnosFileName + ".");         }
+                       else                    {       mothurOut(".");                                                         }
+                       mothurOutEndLine();
                        
                        mothurOut("It took " + toString(time(NULL) - start) + " secs to align " + toString(numFastaSeqs) + " sequences.");
                        mothurOutEndLine();