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);
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();
//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...
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();
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;
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) {
#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();