#include "seqsummarycommand.h"
#include "sequence.hpp"
+//**********************************************************************************************************************
+vector<string> SeqSummaryCommand::getValidParameters(){
+ try {
+ string Array[] = {"fasta","processors","outputdir","inputdir"};
+ vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SeqSummaryCommand", "getValidParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+SeqSummaryCommand::SeqSummaryCommand(){
+ try {
+ abort = true;
+ //initialize outputTypes
+ vector<string> tempOutNames;
+ outputTypes["summary"] = tempOutNames;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SeqSummaryCommand", "SeqSummaryCommand");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+vector<string> SeqSummaryCommand::getRequiredParameters(){
+ try {
+ string Array[] = {"fasta"};
+ vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SeqSummaryCommand", "getRequiredParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+vector<string> SeqSummaryCommand::getRequiredFiles(){
+ try {
+ vector<string> myArray;
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SeqSummaryCommand", "getRequiredFiles");
+ exit(1);
+ }
+}
//***************************************************************************************************************
SeqSummaryCommand::SeqSummaryCommand(string option) {
}
}
+ //initialize outputTypes
+ vector<string> tempOutNames;
+ outputTypes["summary"] = tempOutNames;
+
//check for required parameters
fastafile = validParameter.validFile(parameters, "fasta", true);
if (fastafile == "not open") { abort = true; }
m->mothurOutEndLine();
m->mothurOut("Output File Name: "); m->mothurOutEndLine();
- m->mothurOut(summaryFile); m->mothurOutEndLine();
+ m->mothurOut(summaryFile); m->mothurOutEndLine(); outputNames.push_back(summaryFile); outputTypes["summary"].push_back(summaryFile);
m->mothurOutEndLine();
#ifdef USE_MPI
count++;
}
- unsigned long int pos = in.tellg();
- if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ unsigned long int pos = in.tellg();
+ if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #else
+ if (in.eof()) { break; }
+ #endif
//report progress
- if((count) % 100 == 0){ m->mothurOut(toString(count)); m->mothurOutEndLine(); }
+ //if((count) % 100 == 0){ m->mothurOut(toString(count)); m->mothurOutEndLine(); }
}
//report progress
- if((count) % 100 != 0){ m->mothurOut(toString(count)); m->mothurOutEndLine(); }
+ //if((count) % 100 != 0){ m->mothurOut(toString(count)); m->mothurOutEndLine(); }
in.close();
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