if(nj_args.version) {
printf("Clearcut Version: %s\n", NJ_VERSION);
- exit(0);
+ //exit(0);
}
if(nj_args.help) {
NJ_usage();
- exit(0);
+ //exit(0);
}
/* if stdin & explicit filename are specified for input */
if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
m->mothurOut("Selected " + toString(names.size()) + " sequences. From the groups: "); m->mothurOutEndLine();
- for (int i = 0; i < Groups.size(); i++) { m->mothurOut(Groups[i]); m->mothurOutEndLine(); }
+ for (int i = 0; i < Groups.size(); i++) { m->mothurOut(Groups[i]); m->mothurOut(" contains " + toString(groupMap->getNumSeqs(Groups[i]))); m->mothurOutEndLine(); }
m->mothurOutEndLine();
+
+
if (outputNames.size() != 0) {
m->mothurOutEndLine();
m->mothurOut("Output File names: "); m->mothurOutEndLine();
//**********************************************************************************************************************
int HelpCommand::execute(){
- validCommands->printCommands(cout);
- m->mothurOut("For more information about a specific command type 'commandName(help)' i.e. 'read.dist(help)'"); m->mothurOutEndLine();
+ try {
+ validCommands->printCommands(cout);
+ m->mothurOut("For more information about a specific command type 'commandName(help)' i.e. 'read.dist(help)'"); m->mothurOutEndLine();
- m->mothurOutEndLine(); m->mothurOut("For further assistance please refer to the Mothur manual on our wiki at http://www.mothur.org/wiki, or contact Pat Schloss at mothur.bugs@gmail.com.\n");
+ m->mothurOutEndLine(); m->mothurOut("For further assistance please refer to the Mothur manual on our wiki at http://www.mothur.org/wiki, or contact Pat Schloss at mothur.bugs@gmail.com.\n");
- return 0;
+ return 0;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "HelpCommand", "execute");
+ exit(1);
+ }
}
//**********************************************************************************************************************/
if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
m->mothurOut("Removed " + toString(names.size()) + " sequences. From the groups: "); m->mothurOutEndLine();
- for (int i = 0; i < Groups.size(); i++) { m->mothurOut(Groups[i]); m->mothurOutEndLine(); }
+ for (int i = 0; i < Groups.size(); i++) { m->mothurOut(Groups[i]); m->mothurOut(" contains " + toString(groupMap->getNumSeqs(Groups[i]))); m->mothurOutEndLine(); }
m->mothurOutEndLine();
if (outputNames.size() != 0) {
int SffInfoCommand::decodeName(string& timestamp, string& region, string& xy, string name) {
try {
- string time = name.substr(0, 6);
- unsigned int timeNum = m->fromBase36(time);
-
- int q1 = timeNum / 60;
- int sec = timeNum - 60 * q1;
- int q2 = q1 / 60;
- int minute = q1 - 60 * q2;
- int q3 = q2 / 24;
- int hr = q2 - 24 * q3;
- int q4 = q3 / 32;
- int day = q3 - 32 * q4;
- int q5 = q4 / 13;
- int mon = q4 - 13 * q5;
- int year = 2000 + q5;
-
- timestamp = toString(year) + "_" + toString(mon) + "_" + toString(day) + "_" + toString(hr) + "_" + toString(minute) + "_" + toString(sec);
-
- region = name.substr(7, 2);
-
- string xyNum = name.substr(9);
- unsigned int myXy = m->fromBase36(xyNum);
- int x = myXy >> 12;
- int y = myXy & 4095;
-
- xy = toString(x) + "_" + toString(y);
+ if (name.length() >= 6) {
+ string time = name.substr(0, 6);
+ unsigned int timeNum = m->fromBase36(time);
+ int q1 = timeNum / 60;
+ int sec = timeNum - 60 * q1;
+ int q2 = q1 / 60;
+ int minute = q1 - 60 * q2;
+ int q3 = q2 / 24;
+ int hr = q2 - 24 * q3;
+ int q4 = q3 / 32;
+ int day = q3 - 32 * q4;
+ int q5 = q4 / 13;
+ int mon = q4 - 13 * q5;
+ int year = 2000 + q5;
+
+ timestamp = toString(year) + "_" + toString(mon) + "_" + toString(day) + "_" + toString(hr) + "_" + toString(minute) + "_" + toString(sec);
+ }
+
+ if (name.length() >= 9) {
+ region = name.substr(7, 2);
+
+ string xyNum = name.substr(9);
+ unsigned int myXy = m->fromBase36(xyNum);
+ int x = myXy >> 12;
+ int y = myXy & 4095;
+
+ xy = toString(x) + "_" + toString(y);
+ }
+
return 0;
}
catch(exception& e) {