]> git.donarmstrong.com Git - mothur.git/blobdiff - binsequencecommand.cpp
added cutoff change to hcluster
[mothur.git] / binsequencecommand.cpp
index d1764acec4602f5d90783f7a0abf35195b63149d..8e8ec2bc51362d8b8876d6e3cbb10ef9ff5e167e 100644 (file)
@@ -41,7 +41,7 @@ string BinSeqCommand::getHelpString(){
                helpString += "The default value for label is all lines in your inputfile.\n";
                helpString += "The bin.seqs command outputs a .fasta file for each distance you specify appending the OTU number to each name.\n";
                helpString += "If you provide a groupfile, then it also appends the sequences group to the name.\n";
-               helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n\n";
+               helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n";
                return helpString;
        }
        catch(exception& e) {
@@ -71,6 +71,7 @@ BinSeqCommand::BinSeqCommand(string option) {
                
                //allow user to run help
                if(option == "help") { help(); abort = true; calledHelp = true; }
+               else if(option == "citation") { citation(); abort = true; calledHelp = true;}
                
                else {
                        vector<string> myArray = setParameters();
@@ -137,6 +138,7 @@ BinSeqCommand::BinSeqCommand(string option) {
                                else {  m->mothurOut("You have no current fasta file and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; }
                        }
                        else if (fastafile == "not open") { abort = true; }     
+                       else { m->setFastaFile(fastafile); }
                        
                        listfile = validParameter.validFile(parameters, "list", true);
                        if (listfile == "not found") {                  
@@ -145,6 +147,7 @@ BinSeqCommand::BinSeqCommand(string option) {
                                else {  m->mothurOut("You have no current list file and the list parameter is required."); m->mothurOutEndLine(); abort = true; }
                        }
                        else if (listfile == "not open") { listfile = ""; abort = true; }       
+                       else { m->setListFile(listfile); }
                        
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
                        outputDir = validParameter.validFile(parameters, "outputdir", false);           if (outputDir == "not found"){  
@@ -166,10 +169,12 @@ BinSeqCommand::BinSeqCommand(string option) {
                        namesfile = validParameter.validFile(parameters, "name", true);
                        if (namesfile == "not open") { abort = true; }  
                        else if (namesfile == "not found") { namesfile = ""; }
+                       else {  m->setNameFile(namesfile); }
 
                        groupfile = validParameter.validFile(parameters, "group", true);
                        if (groupfile == "not open") { abort = true; }
                        else if (groupfile == "not found") { groupfile = ""; }
+                       else { m->setGroupFile(groupfile); }
                        
                }
        }
@@ -281,10 +286,6 @@ int BinSeqCommand::execute(){
                
                if(m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str());         }  return 0; }  
                
-               delete input;  
-               delete fasta; 
-               if (groupfile != "") {  delete groupMap;   } 
-               
                m->mothurOutEndLine();
                m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                for (int i = 0; i < outputNames.size(); i++) {  m->mothurOut(outputNames[i]); m->mothurOutEndLine();    }