]> git.donarmstrong.com Git - mothur.git/blobdiff - binsequencecommand.cpp
added set.current and get.current commands and modified existing commands to update...
[mothur.git] / binsequencecommand.cpp
index bf14d6b07b3b6ae64c20d3072abb3c3603a9e42c..8b137c8935e099f6e806f60746244c0d244b9687 100644 (file)
@@ -48,8 +48,7 @@ vector<string> BinSeqCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 BinSeqCommand::BinSeqCommand(){        
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
        }
@@ -62,12 +61,12 @@ BinSeqCommand::BinSeqCommand(){
 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
@@ -218,7 +217,7 @@ BinSeqCommand::~BinSeqCommand(){
 
 int BinSeqCommand::execute(){
        try {
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
        
                int error = 0;
                
@@ -388,7 +387,7 @@ int BinSeqCommand::process(ListVector* list) {
                                                if (sequence != "not found") {
                                                        //if you don't have groups
                                                        if (groupfile == "") {
-                                                               name = name + "|" + toString(i+1);
+                                                               name = name + "\t" + toString(i+1);
                                                                out << ">" << name << endl;
                                                                out << sequence << endl;
                                                        }else {//if you do have groups
@@ -397,7 +396,7 @@ int BinSeqCommand::process(ListVector* list) {
                                                                        m->mothurOut(name + " is missing from your group file. Please correct. ");  m->mothurOutEndLine();
                                                                        return 1;
                                                                }else{
-                                                                       name = name + "|" + group + "|" + toString(i+1);
+                                                                       name = name + "\t" + group + "\t" + toString(i+1);
                                                                        out << ">" << name << endl;
                                                                        out << sequence << endl;
                                                                }
@@ -414,7 +413,7 @@ int BinSeqCommand::process(ListVector* list) {
                                        if (sequence != "not found") {
                                                //if you don't have groups
                                                if (groupfile == "") {
-                                                       binnames = binnames + "|" + toString(i+1);
+                                                       binnames = binnames + "\t" + toString(i+1);
                                                        out << ">" << binnames << endl;
                                                        out << sequence << endl;
                                                }else {//if you do have groups
@@ -423,7 +422,7 @@ int BinSeqCommand::process(ListVector* list) {
                                                                m->mothurOut(binnames + " is missing from your group file. Please correct. "); m->mothurOutEndLine();
                                                                return 1;
                                                        }else{
-                                                               binnames = binnames + "|" + group + "|" + toString(i+1);
+                                                               binnames = binnames + "\t" + group + "\t" + toString(i+1);
                                                                out << ">" << binnames << endl;
                                                                out << sequence << endl;
                                                        }