//**********************************************************************************************************************
AlignCommand::AlignCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["alignreport"] = tempOutNames;
//**********************************************************************************************************************
AlignCommand::AlignCommand(string option) {
try {
- abort = false;
+ abort = false; calledHelp = false;
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true;}
else {
int AlignCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
templateDB = new AlignmentDB(templateFileName, search, kmerSize, gapOpen, gapExtend, match, misMatch);
int longestBase = templateDB->getLongestBase();
int start = time(NULL);
#ifdef USE_MPI
- int pid, end, numSeqsPerProcessor;
+ int pid, numSeqsPerProcessor;
int tag = 2001;
vector<unsigned long int> MPIPos;
MPIWroteAccnos = false;
if (m->control_pressed) { return 0; }
Sequence* candidateSeq = new Sequence(inFASTA); m->gobble(inFASTA);
-
+ report.setCandidate(candidateSeq);
+
int origNumBases = candidateSeq->getNumBases();
string originalUnaligned = candidateSeq->getUnaligned();
int numBasesNeeded = origNumBases * threshold;
accnosFile << candidateSeq->getName() << wasBetter << endl;
}
- report.setCandidate(candidateSeq);
report.setTemplate(templateSeq);
report.setSearchParameters(search, searchScore);
report.setAlignmentParameters(align, alignment);
istringstream iss (tempBuf,istringstream::in);
Sequence* candidateSeq = new Sequence(iss);
-
+ report.setCandidate(candidateSeq);
+
int origNumBases = candidateSeq->getNumBases();
string originalUnaligned = candidateSeq->getUnaligned();
int numBasesNeeded = origNumBases * threshold;
MPIWroteAccnos = true;
}
- report.setCandidate(candidateSeq);
report.setTemplate(templateSeq);
report.setSearchParameters(search, searchScore);
report.setAlignmentParameters(align, alignment);
out.close();
exit(0);
- }else { m->mothurOut("unable to spawn the necessary processes."); m->mothurOutEndLine(); exit(0); }
+ }else {
+ m->mothurOut("[ERROR]: unable to spawn the necessary processes."); m->mothurOutEndLine();
+ for (int i = 0; i < processIDS.size(); i++) { kill (processIDS[i], SIGINT); }
+ exit(0);
+ }
}
//force parent to wait until all the processes are done