//**********************************************************************************************************************
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();
vector<string> candidateFileNames;
vector<string> outputNames;
- bool abort, flip;
+ bool abort, flip, calledHelp;
+
};
#endif
//**********************************************************************************************************************
AmovaCommand::AmovaCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["amova"] = tempOutNames;
}
AmovaCommand::AmovaCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int AmovaCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//read design file
designMap = new GroupMap(designfile);
//**********************************************************************************************************************
BinSeqCommand::BinSeqCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
}
BinSeqCommand::BinSeqCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int BinSeqCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
int error = 0;
//**********************************************************************************************************************
BootSharedCommand::BootSharedCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["tree"] = tempOutNames;
}
BootSharedCommand::BootSharedCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
Groups.clear();
Estimators.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int BootSharedCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
util = new SharedUtil();
//**********************************************************************************************************************
CatchAllCommand::CatchAllCommand(){
try {
+ abort = true; calledHelp = true;
//initialize outputTypes
vector<string> tempOutNames;
outputTypes["csv"] = tempOutNames;
CatchAllCommand::CatchAllCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int CatchAllCommand::execute() {
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//prepare full output directory
outputDir = m->getFullPathName(outputDir);
//**********************************************************************************************************************
ChimeraBellerophonCommand::ChimeraBellerophonCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["chimera"] = tempOutNames;
outputTypes["accnos"] = tempOutNames;
//***************************************************************************************************************
ChimeraBellerophonCommand::ChimeraBellerophonCommand(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 {
//valid paramters for this command
int ChimeraBellerophonCommand::execute(){
try{
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
for (int i = 0; i < fastaFileNames.size(); i++) {
//**********************************************************************************************************************
ChimeraCcodeCommand::ChimeraCcodeCommand(){
try {
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["chimera"] = tempOutNames;
outputTypes["mapinfo"] = tempOutNames;
//***************************************************************************************************************
ChimeraCcodeCommand::ChimeraCcodeCommand(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 {
//valid paramters for this command
int ChimeraCcodeCommand::execute(){
try{
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
for (int s = 0; s < fastaFileNames.size(); s++) {
//**********************************************************************************************************************
ChimeraCheckCommand::ChimeraCheckCommand(){
try {
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["chimera"] = tempOutNames;
}
//***************************************************************************************************************
ChimeraCheckCommand::ChimeraCheckCommand(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 {
//valid paramters for this command
int ChimeraCheckCommand::execute(){
try{
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
for (int i = 0; i < fastaFileNames.size(); i++) {
//**********************************************************************************************************************
ChimeraPintailCommand::ChimeraPintailCommand(){
try {
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["chimera"] = tempOutNames;
outputTypes["accnos"] = tempOutNames;
//***************************************************************************************************************
ChimeraPintailCommand::ChimeraPintailCommand(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 {
//valid paramters for this command
int ChimeraPintailCommand::execute(){
try{
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
for (int s = 0; s < fastaFileNames.size(); s++) {
//**********************************************************************************************************************
ChimeraSlayerCommand::ChimeraSlayerCommand(){
try {
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["chimera"] = tempOutNames;
outputTypes["accnos"] = tempOutNames;
//***************************************************************************************************************
ChimeraSlayerCommand::ChimeraSlayerCommand(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 {
//valid paramters for this command
int ChimeraSlayerCommand::execute(){
try{
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
for (int s = 0; s < fastaFileNames.size(); s++) {
//**********************************************************************************************************************
ChopSeqsCommand::ChopSeqsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["accnos"] = tempOutNames;
//**********************************************************************************************************************
ChopSeqsCommand::ChopSeqsCommand(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 {
//valid paramters for this command
int ChopSeqsCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
string outputFileName = outputDir + m->getRootName(m->getSimpleName(fastafile)) + "chop.fasta";
string outputFileNameAccnos = outputDir + m->getRootName(m->getSimpleName(fastafile)) + "chop.accnos";
//**********************************************************************************************************************
ClassifyOtuCommand::ClassifyOtuCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["constaxonomy"] = tempOutNames;
outputTypes["taxsummary"] = tempOutNames;
//**********************************************************************************************************************
ClassifyOtuCommand::ClassifyOtuCommand(string option) {
try{
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
//allow user to run help
if (option == "help") {
- help(); abort = true;
+ help(); abort = true; calledHelp = true;
} else {
//valid paramters for this command
string Array[] = {"list","label","name","taxonomy","cutoff","probs","basis","reftaxonomy","group","outputdir","inputdir"};
int ClassifyOtuCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//if user gave a namesfile then use it
if (namefile != "") { readNamesFile(); }
//**********************************************************************************************************************
ClassifySeqsCommand::ClassifySeqsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["taxonomy"] = tempOutNames;
outputTypes["taxsummary"] = tempOutNames;
//**********************************************************************************************************************
ClassifySeqsCommand::ClassifySeqsCommand(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 ClassifySeqsCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
if(method == "bayesian"){ classify = new Bayesian(taxonomyFileName, templateFileName, search, kmerSize, cutoff, iters); }
else if(method == "knn"){ classify = new Knn(taxonomyFileName, templateFileName, search, kmerSize, gapOpen, gapExtend, match, misMatch, numWanted); }
//**********************************************************************************************************************
ClearcutCommand::ClearcutCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["tree"] = tempOutNames;
outputTypes["matrixout"] = tempOutNames;
/**************************************************************************************/
ClearcutCommand::ClearcutCommand(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 {
//valid paramters for this command
int ClearcutCommand::execute() {
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//prepare filename
string outputName = outputDir + m->getRootName(m->getSimpleName(inputFile)) + "tre";
//**********************************************************************************************************************
ClusterCommand::ClusterCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["list"] = tempOutNames;
outputTypes["rabund"] = tempOutNames;
try{
globaldata = GlobalData::getInstance();
- 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 {
//valid paramters for this command
int ClusterCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
time_t estart = time(NULL);
//int ndist = matrix->getNNodes();
//**********************************************************************************************************************
ClusterDoturCommand::ClusterDoturCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["list"] = tempOutNames;
outputTypes["rabund"] = tempOutNames;
ClusterDoturCommand::ClusterDoturCommand(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 {
//valid paramters for this command
int ClusterDoturCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
if(namefile != ""){
nameMap = new NameAssignment(namefile);
//**********************************************************************************************************************
ClusterFragmentsCommand::ClusterFragmentsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["name"] = tempOutNames;
//**********************************************************************************************************************
ClusterFragmentsCommand::ClusterFragmentsCommand(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 {
//valid paramters for this command
int ClusterFragmentsCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
int start = time(NULL);
//**********************************************************************************************************************
ClusterSplitCommand::ClusterSplitCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["list"] = tempOutNames;
outputTypes["rabund"] = tempOutNames;
ClusterSplitCommand::ClusterSplitCommand(string option) {
try{
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
format = "";
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int ClusterSplitCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
time_t estart;
vector<string> listFileNames;
//**********************************************************************************************************************
CollectCommand::CollectCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["sobs"] = tempOutNames;
outputTypes["chao"] = tempOutNames;
CollectCommand::CollectCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
Estimators.clear();
int CollectCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
string hadShared = "";
if ((globaldata->getFormat() != "sharedfile")) { inputFileNames.push_back(globaldata->inputFileName); }
//**********************************************************************************************************************
CollectSharedCommand::CollectSharedCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["sharedchao"] = tempOutNames;
outputTypes["sharedsobs"] = tempOutNames;
CollectSharedCommand::CollectSharedCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
Estimators.clear();
Groups.clear();
//allow user to run help
- if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; }
+ if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int CollectSharedCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//if the users entered no valid calculators don't execute command
if (cDisplays.size() == 0) { return 0; }
virtual ~Command() { }
protected:
MothurOut* m;
+ bool calledHelp;
};
#endif
//**********************************************************************************************************************
ConcensusCommand::ConcensusCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["tree"] = tempOutNames;
outputTypes["nodepairs"] = tempOutNames;
ConcensusCommand::ConcensusCommand(string fileroot) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
//initialize outputTypes
vector<string> tempOutNames;
int ConcensusCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
else {
numNodes = t[0]->getNumNodes();
numLeaves = t[0]->getNumLeaves();
//**********************************************************************************************************************
ConsensusSeqsCommand::ConsensusSeqsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["name"] = tempOutNames;
//***************************************************************************************************************
ConsensusSeqsCommand::ConsensusSeqsCommand(string option) {
try {
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int ConsensusSeqsCommand::execute(){
try{
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
readFasta();
//**********************************************************************************************************************
CorrAxesCommand::CorrAxesCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["corr.axes"] = tempOutNames;
}
//**********************************************************************************************************************
CorrAxesCommand::CorrAxesCommand(string option) {
try {
- abort = false;
+ abort = false; calledHelp = false;
globaldata = GlobalData::getInstance();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int CorrAxesCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
/*************************************************************************************/
// use smart distancing to get right sharedRabund and convert to relabund if needed //
//**********************************************************************************************************************
DeconvoluteCommand::DeconvoluteCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["name"] = tempOutNames;
/**************************************************************************************/
DeconvoluteCommand::DeconvoluteCommand(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 {
//valid paramters for this command
int DeconvoluteCommand::execute() {
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//prepare filenames and open files
string outNameFile = outputDir + m->getRootName(m->getSimpleName(inFastaName)) + "names";
//**********************************************************************************************************************
DegapSeqsCommand::DegapSeqsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
}
//***************************************************************************************************************
DegapSeqsCommand::DegapSeqsCommand(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 {
//valid paramters for this command
int DegapSeqsCommand::execute(){
try{
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
for (int s = 0; s < fastaFileNames.size(); s++) {
//**********************************************************************************************************************
DeUniqueSeqsCommand::DeUniqueSeqsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
}
/**************************************************************************************/
DeUniqueSeqsCommand::DeUniqueSeqsCommand(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 {
//valid paramters for this command
int DeUniqueSeqsCommand::execute() {
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//prepare filenames and open files
ofstream out;
//**********************************************************************************************************************
DistanceCommand::DistanceCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["phylip"] = tempOutNames;
outputTypes["column"] = tempOutNames;
//**********************************************************************************************************************
DistanceCommand::DistanceCommand(string option) {
try {
- abort = false;
+ abort = false; calledHelp = false;
Estimators.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int DistanceCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
int startTime = time(NULL);
//executes valid command
Command* command = cFactory->getCommand(commandName, options);
quitCommandCalled = command->execute();
+
+ //if we aborted command
+ if (quitCommandCalled == 2) { mout->mothurOut("[ERROR]: did not complete " + commandName + "."); mout->mothurOutEndLine(); }
+
mout->control_pressed = 0;
mout->executing = false;
//CommandFactory cFactory;
int quitCommandCalled = 0;
int count = 0;
- while(quitCommandCalled == 0){
+ while(quitCommandCalled != 1){
#ifdef USE_MPI
int pid, processors;
//executes valid command
Command* command = cFactory->getCommand(commandName, options);
quitCommandCalled = command->execute();
+
+ //if we aborted command
+ if (quitCommandCalled == 2) { mout->mothurOut("[ERROR]: did not complete " + commandName + "."); mout->mothurOutEndLine(); }
+
mout->control_pressed = 0;
mout->executing = false;
//CommandFactory cFactory;
int quitCommandCalled = 0;
- while(quitCommandCalled == 0){
+ while(quitCommandCalled != 1){
#ifdef USE_MPI
int pid, processors;
//executes valid command
Command* command = cFactory->getCommand(commandName, options);
quitCommandCalled = command->execute();
+
+ //if we aborted command
+ if (quitCommandCalled == 2) { mout->mothurOut("[ERROR]: did not complete " + commandName + "."); mout->mothurOutEndLine(); }
+
mout->control_pressed = 0;
mout->executing = false;
//**********************************************************************************************************************
FilterSeqsCommand::FilterSeqsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["filter"] = tempOutNames;
/**************************************************************************************/
FilterSeqsCommand::FilterSeqsCommand(string option) {
try {
- abort = false;
+ abort = false; calledHelp = false;
filterFileName = "";
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int FilterSeqsCommand::execute() {
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
ifstream inFASTA;
m->openInputFile(fastafileNames[0], inFASTA);
//**********************************************************************************************************************
GetgroupCommand::GetgroupCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["bootgroup"] = tempOutNames;
}
GetgroupCommand::GetgroupCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- 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 {
//valid paramters for this command
int GetgroupCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
int num, inputData, count;
count = 0;
//**********************************************************************************************************************
GetGroupsCommand::GetGroupsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["taxonomy"] = tempOutNames;
//**********************************************************************************************************************
GetGroupsCommand::GetGroupsCommand(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 {
//valid paramters for this command
int GetGroupsCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
groupMap = new GroupMap(groupfile);
groupMap->readMap();
GetlabelCommand::GetlabelCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- 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 {
if ((globaldata->getListFile() == "") && (globaldata->getRabundFile() == "") && (globaldata->getSabundFile() == "")) { m->mothurOut("You must read a list, sabund or rabund before you can use the get.label command."); m->mothurOutEndLine(); abort = true; }
int GetlabelCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
filename = globaldata->inputFileName;
ifstream in;
//**********************************************************************************************************************
GetLineageCommand::GetLineageCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["taxonomy"] = tempOutNames;
//**********************************************************************************************************************
GetLineageCommand::GetLineageCommand(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 {
//valid paramters for this command
int GetLineageCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
if (m->control_pressed) { return 0; }
//**********************************************************************************************************************
GetListCountCommand::GetListCountCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["otu"] = tempOutNames;
}
GetListCountCommand::GetListCountCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int GetListCountCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
globaldata->setFormat("list");
//**********************************************************************************************************************
GetOTURepCommand::GetOTURepCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["name"] = tempOutNames;
GetOTURepCommand::GetOTURepCommand(string option) {
try{
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
//allow user to run help
if (option == "help") {
- help(); abort = true;
+ help(); abort = true; calledHelp = true;
} else {
//valid paramters for this command
string Array[] = {"fasta","list","label","name","weighted", "group", "sorted", "phylip","column","large","cutoff","precision","groups","outputdir","inputdir"};
int GetOTURepCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
int error;
if (!large) {
//**********************************************************************************************************************
GetOtusCommand::GetOtusCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["group"] = tempOutNames;
outputTypes["list"] = tempOutNames;
//**********************************************************************************************************************
GetOtusCommand::GetOtusCommand(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 {
//valid paramters for this command
int GetOtusCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
groupMap = new GroupMap(groupfile);
groupMap->readMap();
//**********************************************************************************************************************
GetRAbundCommand::GetRAbundCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["rabund"] = tempOutNames;
}
GetRAbundCommand::GetRAbundCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int GetRAbundCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//read first line
read = new ReadOTUFile(globaldata->inputFileName);
//**********************************************************************************************************************
GetRelAbundCommand::GetRelAbundCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["relabund"] = tempOutNames;
}
GetRelAbundCommand::GetRelAbundCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int GetRelAbundCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
string outputFileName = outputDir + m->getRootName(m->getSimpleName(globaldata->inputFileName)) + "relabund";
ofstream out;
//**********************************************************************************************************************
GetSAbundCommand::GetSAbundCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["sabund"] = tempOutNames;
}
GetSAbundCommand::GetSAbundCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int GetSAbundCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//using order vector so you don't have to distinguish between the list and rabund files
read = new ReadOTUFile(globaldata->inputFileName);
//**********************************************************************************************************************
GetSeqsCommand::GetSeqsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["taxonomy"] = tempOutNames;
//**********************************************************************************************************************
GetSeqsCommand::GetSeqsCommand(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 {
//valid paramters for this command
int GetSeqsCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//get names you want to keep
readAccnos();
//**********************************************************************************************************************
GetSharedOTUCommand::GetSharedOTUCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["accnos"] = tempOutNames;
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
unique = true;
allLines = 1;
labels.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int GetSharedOTUCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
groupMap = new GroupMap(groupfile);
int error = groupMap->readMap();
//**********************************************************************************************************************
HClusterCommand::HClusterCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["list"] = tempOutNames;
outputTypes["rabund"] = tempOutNames;
HClusterCommand::HClusterCommand(string option) {
try{
globaldata = GlobalData::getInstance();
- 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 {
//valid paramters for this command
int HClusterCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
if(namefile != ""){
globaldata->nameMap = new NameAssignment(namefile);
//**********************************************************************************************************************
HeatMapCommand::HeatMapCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["svg"] = tempOutNames;
}
HeatMapCommand::HeatMapCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int HeatMapCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
heatmap = new HeatMap(sorted, scale, numOTU, fontSize, outputDir);
format = globaldata->getFormat();
//**********************************************************************************************************************
HeatMapSimCommand::HeatMapSimCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["svg"] = tempOutNames;
}
HeatMapSimCommand::HeatMapSimCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
Groups.clear();
Estimators.clear();
//allow user to run help
- if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; }
+ if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int HeatMapSimCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
heatmap = new HeatMapSim(outputDir);
//**********************************************************************************************************************
HomovaCommand::HomovaCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["homova"] = tempOutNames;
}
HomovaCommand::HomovaCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int HomovaCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//read design file
designMap = new GroupMap(designfile);
//**********************************************************************************************************************
IndicatorCommand::IndicatorCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["tree"] = tempOutNames;
outputTypes["summary"] = tempOutNames;
IndicatorCommand::IndicatorCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- 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 {
//valid paramters for this command
int IndicatorCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//read designfile if given and set up globaldatas groups for read of sharedfiles
if (designfile != "") {
//**********************************************************************************************************************
LibShuffCommand::LibShuffCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["coverage"] = tempOutNames;
outputTypes["libshuffsummary"] = tempOutNames;
LibShuffCommand::LibShuffCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
Groups.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int LibShuffCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
savedDXYValues = form->evaluateAll();
savedMinValues = form->getSavedMins();
//**********************************************************************************************************************
ListSeqsCommand::ListSeqsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["accnos"] = tempOutNames;
}
ListSeqsCommand::ListSeqsCommand(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 {
//valid paramters for this command
int ListSeqsCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//read functions fill names vector
if (fastafile != "") { inputFileName = fastafile; readFasta(); }
//**********************************************************************************************************************
MakeGroupCommand::MakeGroupCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["group"] = tempOutNames;
}
MakeGroupCommand::MakeGroupCommand(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 MakeGroupCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
if (outputDir == "") { outputDir = m->hasPath(fastaFileNames[0]); }
//**********************************************************************************************************************
MatrixOutputCommand::MatrixOutputCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["phylip"] = tempOutNames;
}
MatrixOutputCommand::MatrixOutputCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
Groups.clear();
Estimators.clear();
//allow user to run help
- if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; }
+ if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int MatrixOutputCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//if the users entered no valid calculators don't execute command
if (matrixCalculators.size() == 0) { m->mothurOut("No valid calculators."); m->mothurOutEndLine(); return 0; }
//**********************************************************************************************************************
MergeFileCommand::MergeFileCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["merge"] = tempOutNames;
}
MergeFileCommand::MergeFileCommand(string option) {
try {
- abort = false;
+ abort = false; calledHelp = false;
if(option == "help") {
help();
- abort = true;
+ abort = true; calledHelp = true;
}
else {
//valid paramters for this command
int MergeFileCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
ofstream outputFile;
m->openOutputFile(outputFileName, outputFile);
//**********************************************************************************************************************
MergeGroupsCommand::MergeGroupsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["shared"] = tempOutNames;
}
MergeGroupsCommand::MergeGroupsCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int MergeGroupsCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
if (outputDir == "") { outputDir += m->hasPath(sharedfile); }
string outputFileName = outputDir + m->getRootName(m->getSimpleName(sharedfile)) + "merge" + m->getExtension(sharedfile);
//**********************************************************************************************************************
MetaStatsCommand::MetaStatsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["metastats"] = tempOutNames;
}
MetaStatsCommand::MetaStatsCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int MetaStatsCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
designMap = new GroupMap(designfile);
designMap->readDesignMap();
//**********************************************************************************************************************
MGClusterCommand::MGClusterCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["list"] = tempOutNames;
outputTypes["rabund"] = tempOutNames;
MGClusterCommand::MGClusterCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- 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 {
//valid paramters for this command
int MGClusterCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//read names file
if (namefile != "") {
//**********************************************************************************************************************
NMDSCommand::NMDSCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["nmds"] = tempOutNames;
outputTypes["stress"] = tempOutNames;
NMDSCommand::NMDSCommand(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 {
//valid paramters for this command
int NMDSCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
cout.setf(ios::fixed, ios::floatfield);
cout.setf(ios::showpoint);
//**********************************************************************************************************************
NormalizeSharedCommand::NormalizeSharedCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["shared"] = tempOutNames;
}
NormalizeSharedCommand::NormalizeSharedCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int NormalizeSharedCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
string outputFileName = outputDir + m->getRootName(m->getSimpleName(globaldata->inputFileName)) + "norm.shared";
ofstream out;
//**********************************************************************************************************************
OtuHierarchyCommand::OtuHierarchyCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["otuheirarchy"] = tempOutNames;
}
//**********************************************************************************************************************
OtuHierarchyCommand::OtuHierarchyCommand(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 {
//valid paramters for this command
int OtuHierarchyCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//get listvectors that correspond to labels requested, (or use smart distancing to get closest listvector)
vector<ListVector> lists = getListVectors();
//**********************************************************************************************************************
PairwiseSeqsCommand::PairwiseSeqsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["phylip"] = tempOutNames;
outputTypes["column"] = tempOutNames;
//**********************************************************************************************************************
PairwiseSeqsCommand::PairwiseSeqsCommand(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 PairwiseSeqsCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
int longestBase = 2000; //will need to update this in driver if we find sequences with more bases. hardcoded so we don't have the pre-read user fasta file.
//**********************************************************************************************************************
ParseFastaQCommand::ParseFastaQCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["qual"] = tempOutNames;
//**********************************************************************************************************************
ParseFastaQCommand::ParseFastaQCommand(string option){
try {
- abort = false;
+ abort = false; calledHelp = false;
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int ParseFastaQCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//open Output Files
string fastaFile = outputDir + m->getRootName(m->getSimpleName(fastaQFile)) + "fasta";
//**********************************************************************************************************************
ParseListCommand::ParseListCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["list"] = tempOutNames;
}
//**********************************************************************************************************************
ParseListCommand::ParseListCommand(string option) {
try {
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int ParseListCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//set fileroot
string fileroot = outputDir + m->getRootName(m->getSimpleName(listfile));
//**********************************************************************************************************************
ParsimonyCommand::ParsimonyCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["parsimony"] = tempOutNames;
outputTypes["psummary"] = tempOutNames;
ParsimonyCommand::ParsimonyCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
Groups.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int ParsimonyCommand::execute() {
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
Progress* reading;
reading = new Progress("Comparing to random:", iters);
//**********************************************************************************************************************
PCACommand::PCACommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["pca"] = tempOutNames;
outputTypes["loadings"] = tempOutNames;
PCACommand::PCACommand(string option) {
try {
- abort = false;
+ abort = false; calledHelp = false;
globaldata = GlobalData::getInstance();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int PCACommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
cout.setf(ios::fixed, ios::floatfield);
cout.setf(ios::showpoint);
//**********************************************************************************************************************
PCOACommand::PCOACommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["pcoa"] = tempOutNames;
outputTypes["loadings"] = tempOutNames;
PCOACommand::PCOACommand(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 {
//valid paramters for this command
int PCOACommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
cout.setf(ios::fixed, ios::floatfield);
cout.setf(ios::showpoint);
//**********************************************************************************************************************
PhyloDiversityCommand::PhyloDiversityCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["phylodiv"] = tempOutNames;
outputTypes["rarefy"] = tempOutNames;
PhyloDiversityCommand::PhyloDiversityCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- 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 {
//valid paramters for this command
int PhyloDiversityCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//incase the user had some mismatches between the tree and group files we don't want group xxx to be analyzed
for (int i = 0; i < globaldata->Groups.size(); i++) { if (globaldata->Groups[i] == "xxx") { globaldata->Groups.erase(globaldata->Groups.begin()+i); break; } }
//**********************************************************************************************************************
PhylotypeCommand::PhylotypeCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["list"] = tempOutNames;
outputTypes["sabund"] = tempOutNames;
/**********************************************************************************************************************/
PhylotypeCommand::PhylotypeCommand(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 PhylotypeCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//reads in taxonomy file and makes all the taxonomies the same length
//by appending the last taxon to a given taxonomy as many times as needed to
PipelineCommand::PipelineCommand(string option) {
try {
cFactory = CommandFactory::getInstance();
- 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 PipelineCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
int start = time(NULL);
public:
PipelineCommand(string);
- PipelineCommand() {}
+ PipelineCommand() { abort = true; calledHelp = true; }
~PipelineCommand();
vector<string> getRequiredParameters();
vector<string> getValidParameters();
//**********************************************************************************************************************
PreClusterCommand::PreClusterCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["name"] = tempOutNames;
PreClusterCommand::PreClusterCommand(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 {
//valid paramters for this command
int PreClusterCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
int start = time(NULL);
//**********************************************************************************************************************
QuitCommand::QuitCommand(string option) {
- 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; }
}
//**********************************************************************************************************************
//**********************************************************************************************************************
RareFactCommand::RareFactCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["rarefaction"] = tempOutNames;
outputTypes["r_chao"] = tempOutNames;
RareFactCommand::RareFactCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
Estimators.clear();
//allow user to run help
- if(option == "help") { validCalculator = new ValidCalculators(); help(); delete validCalculator; abort = true; }
+ if(option == "help") { validCalculator = new ValidCalculators(); help(); delete validCalculator; abort = true; calledHelp = true; }
else {
//valid paramters for this command
int RareFactCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
string hadShared = "";
if ((globaldata->getFormat() != "sharedfile")) { inputFileNames.push_back(globaldata->inputFileName); }
//**********************************************************************************************************************
RareFactSharedCommand::RareFactSharedCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["sharedrarefaction"] = tempOutNames;
outputTypes["sharedr_nseqs"] = tempOutNames;
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
Estimators.clear();
Groups.clear();
//allow user to run help
- if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; }
+ if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int RareFactSharedCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//if the users entered no valid calculators don't execute command
if (rDisplays.size() == 0) { return 0; }
ReadDistCommand::ReadDistCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- 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 {
//valid paramters for this command
int ReadDistCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
time_t start = time(NULL);
size_t numDists = 0;
class ReadDistCommand : public Command {
public:
ReadDistCommand(string);
- ReadDistCommand() {}
+ ReadDistCommand() { abort = true; calledHelp = true; }
~ReadDistCommand();
vector<string> getRequiredParameters();
vector<string> getValidParameters();
//**********************************************************************************************************************
ReadOtuCommand::ReadOtuCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["rabund"] = tempOutNames;
outputTypes["shared"] = tempOutNames;
ReadOtuCommand::ReadOtuCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int ReadOtuCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
if (globaldata->getFormat() == "shared") {
ReadTreeCommand::ReadTreeCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- 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 {
//valid paramters for this command
int ReadTreeCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
int readOk;
class ReadTreeCommand : public Command {
public:
ReadTreeCommand(string);
- ReadTreeCommand() {}
+ ReadTreeCommand() { abort = true; calledHelp = true; }
~ReadTreeCommand();
vector<string> getRequiredParameters();
vector<string> getValidParameters();
//**********************************************************************************************************************
RemoveGroupsCommand::RemoveGroupsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["taxonomy"] = tempOutNames;
//**********************************************************************************************************************
RemoveGroupsCommand::RemoveGroupsCommand(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 {
//valid paramters for this command
int RemoveGroupsCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
groupMap = new GroupMap(groupfile);
groupMap->readMap();
//**********************************************************************************************************************
RemoveLineageCommand::RemoveLineageCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["taxonomy"] = tempOutNames;
//**********************************************************************************************************************
RemoveLineageCommand::RemoveLineageCommand(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 {
//valid paramters for this command
int RemoveLineageCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
if (m->control_pressed) { return 0; }
//**********************************************************************************************************************
RemoveOtusCommand::RemoveOtusCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["group"] = tempOutNames;
outputTypes["list"] = tempOutNames;
//**********************************************************************************************************************
RemoveOtusCommand::RemoveOtusCommand(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 {
//valid paramters for this command
int RemoveOtusCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
groupMap = new GroupMap(groupfile);
groupMap->readMap();
//**********************************************************************************************************************
RemoveRareCommand::RemoveRareCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["rabund"] = tempOutNames;
outputTypes["sabund"] = tempOutNames;
RemoveRareCommand::RemoveRareCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int RemoveRareCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
if (m->control_pressed) { return 0; }
//**********************************************************************************************************************
RemoveSeqsCommand::RemoveSeqsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["taxonomy"] = tempOutNames;
//**********************************************************************************************************************
RemoveSeqsCommand::RemoveSeqsCommand(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 {
//valid paramters for this command
int RemoveSeqsCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//get names you want to keep
readAccnos();
//**********************************************************************************************************************
ReverseSeqsCommand::ReverseSeqsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
}
ReverseSeqsCommand::ReverseSeqsCommand(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 {
//valid paramters for this command
int ReverseSeqsCommand::execute(){
try{
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
ifstream inFASTA;
m->openInputFile(fasta, inFASTA);
//**********************************************************************************************************************
ScreenSeqsCommand::ScreenSeqsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["name"] = tempOutNames;
ScreenSeqsCommand::ScreenSeqsCommand(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 {
//valid paramters for this command
int ScreenSeqsCommand::execute(){
try{
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//if the user want to optimize we need to no the 90% mark
vector<unsigned long int> positions;
//**********************************************************************************************************************
AlignCheckCommand::AlignCheckCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["aligncheck"] = tempOutNames;
}
AlignCheckCommand::AlignCheckCommand(string option) {
try {
- abort = false;
+ abort = false; calledHelp = false;
haderror = 0;
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int AlignCheckCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
//get secondary structure info.
readMap();
//**********************************************************************************************************************
SensSpecCommand::SensSpecCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["sensspec"] = tempOutNames;
}
SensSpecCommand::SensSpecCommand(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 {
string temp;
int SensSpecCommand::execute(){
try{
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
setUpOutput();
outputNames.push_back(sensSpecFileName); outputTypes["sensspec"].push_back(sensSpecFileName);
//**********************************************************************************************************************
SeqErrorCommand::SeqErrorCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["error.summary"] = tempOutNames;
outputTypes["error.seq"] = tempOutNames;
SeqErrorCommand::SeqErrorCommand(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 {
string temp;
int SeqErrorCommand::execute(){
try{
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
string errorSummaryFileName = queryFileName.substr(0,queryFileName.find_last_of('.')) + ".error.summary";
m->openOutputFile(errorSummaryFileName, errorSummaryFile);
//**********************************************************************************************************************
SeqSummaryCommand::SeqSummaryCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["summary"] = tempOutNames;
}
SeqSummaryCommand::SeqSummaryCommand(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 {
//valid paramters for this command
int SeqSummaryCommand::execute(){
try{
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
string summaryFile = outputDir + m->getSimpleName(fastafile) + ".summary";
SetDirectoryCommand::SetDirectoryCommand(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 {
//valid paramters for this command
int SetDirectoryCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
commandFactory = CommandFactory::getInstance();
public:
SetDirectoryCommand(string);
- SetDirectoryCommand() {}
+ SetDirectoryCommand() { abort = true; calledHelp = true; }
~SetDirectoryCommand();
vector<string> getRequiredParameters();
vector<string> getValidParameters();
SetLogFileCommand::SetLogFileCommand(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 {
//valid paramters for this command
int SetLogFileCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
commandFactory = CommandFactory::getInstance();
public:
SetLogFileCommand(string);
- SetLogFileCommand() {}
+ SetLogFileCommand() { abort = true; calledHelp = true; }
~SetLogFileCommand();
vector<string> getRequiredParameters();
vector<string> getValidParameters();
//**********************************************************************************************************************
SffInfoCommand::SffInfoCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["flow"] = tempOutNames;
SffInfoCommand::SffInfoCommand(string option) {
try {
- abort = false;
+ abort = false; calledHelp = false;
hasAccnos = false;
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int SffInfoCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
for (int s = 0; s < filenames.size(); s++) {
//**********************************************************************************************************************
SharedCommand::SharedCommand(){
try {
-
+
//initialize outputTypes
vector<string> tempOutNames;
outputTypes["rabund"] = tempOutNames;
ShhherCommand::ShhherCommand(){
try {
- abort = true;
+ abort = true; calledHelp = true;
//initialize outputTypes
vector<string> tempOutNames;
#endif
- 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 {
#ifdef USE_MPI
int ShhherCommand::execute(){
try {
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
+
int tag = 1976;
MPI_Status status;
//**********************************************************************************************************************
SplitAbundCommand::SplitAbundCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["list"] = tempOutNames;
outputTypes["name"] = tempOutNames;
//**********************************************************************************************************************
SplitAbundCommand::SplitAbundCommand(string option) {
try {
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int SplitAbundCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
if (listfile != "") { //you are using a listfile to determine abundance
if (outputDir == "") { outputDir = m->hasPath(listfile); }
//**********************************************************************************************************************
SplitGroupCommand::SplitGroupCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["name"] = tempOutNames;
//**********************************************************************************************************************
SplitGroupCommand::SplitGroupCommand(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 {
//valid paramters for this command
int SplitGroupCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
groupMap = new GroupMap(groupfile);
groupMap->readMap();
//**********************************************************************************************************************
SubSampleCommand::SubSampleCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["shared"] = tempOutNames;
outputTypes["list"] = tempOutNames;
SubSampleCommand::SubSampleCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int SubSampleCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
if (sharedfile != "") { getSubSampleShared(); }
if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); return 0; } }
//**********************************************************************************************************************
SummaryCommand::SummaryCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["summary"] = tempOutNames;
}
SummaryCommand::SummaryCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
Estimators.clear();
//allow user to run help
- if(option == "help") { validCalculator = new ValidCalculators(); help(); delete validCalculator; abort = true; }
+ if(option == "help") { validCalculator = new ValidCalculators(); help(); delete validCalculator; abort = true; calledHelp = true; }
else {
//valid paramters for this command
int SummaryCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
string hadShared = "";
if ((globaldata->getFormat() != "sharedfile")) { inputFileNames.push_back(globaldata->inputFileName); }
//**********************************************************************************************************************
SummarySharedCommand::SummarySharedCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["summary"] = tempOutNames;
}
SummarySharedCommand::SummarySharedCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
Estimators.clear();
//allow user to run help
- if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; }
+ if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int SummarySharedCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
ofstream outputFileHandle, outAll;
string outputFileName = outputDir + m->getRootName(m->getSimpleName(globaldata->inputFileName)) + "shared.summary";
SystemCommand::SystemCommand(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 {
if (option == "") { m->mothurOut("You must enter a command to run."); m->mothurOutEndLine(); abort = true; }
int SystemCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
system(command.c_str());
public:
SystemCommand(string);
- SystemCommand() {}
+ SystemCommand() { abort = true; calledHelp = true; }
~SystemCommand(){}
vector<string> getRequiredParameters();
vector<string> getValidParameters();
//**********************************************************************************************************************
TreeGroupCommand::TreeGroupCommand(){
try {
- abort = true;
+ abort = true; calledHelp = true;
globaldata = GlobalData::getInstance();
//initialize outputTypes
vector<string> tempOutNames;
TreeGroupCommand::TreeGroupCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
Groups.clear();
Estimators.clear();
//allow user to run help
- if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; }
+ if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int TreeGroupCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
if (format == "sharedfile") {
//if the users entered no valid calculators don't execute command
TrimFlowsCommand::TrimFlowsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["flow"] = tempOutNames;
outputTypes["fasta"] = tempOutNames;
TrimFlowsCommand::TrimFlowsCommand(string option) {
try {
- abort = false;
+ abort = false; calledHelp = false;
comboStarts = 0;
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int TrimFlowsCommand::execute(){
try{
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
string trimFlowFileName = outputDir + m->getRootName(m->getSimpleName(flowFileName)) + "trim.flow";
outputNames.push_back(trimFlowFileName); outputTypes["flow"].push_back(trimFlowFileName);
TrimSeqsCommand::TrimSeqsCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["qual"] = tempOutNames;
TrimSeqsCommand::TrimSeqsCommand(string option) {
try {
- abort = false;
+ abort = false; calledHelp = false;
comboStarts = 0;
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int TrimSeqsCommand::execute(){
try{
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
numFPrimers = 0; //this needs to be initialized
numRPrimers = 0;
UnifracUnweightedCommand::UnifracUnweightedCommand(){
try {
globaldata = GlobalData::getInstance();
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["unweighted"] = tempOutNames;
outputTypes["uwsummary"] = tempOutNames;
UnifracUnweightedCommand::UnifracUnweightedCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
Groups.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int UnifracUnweightedCommand::execute() {
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
int start = time(NULL);
//**********************************************************************************************************************
UnifracWeightedCommand::UnifracWeightedCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["weighted"] = tempOutNames;
outputTypes["wsummary"] = tempOutNames;
UnifracWeightedCommand::UnifracWeightedCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
Groups.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int UnifracWeightedCommand::execute() {
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
int start = time(NULL);
//**********************************************************************************************************************
VennCommand::VennCommand(){
try {
- abort = true;
- //initialize outputTypes
+ abort = true; calledHelp = true;
vector<string> tempOutNames;
outputTypes["svg"] = tempOutNames;
}
VennCommand::VennCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
allLines = 1;
labels.clear();
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
//valid paramters for this command
int VennCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
string lastLabel;