]> git.donarmstrong.com Git - mothur.git/blobdiff - deuniqueseqscommand.cpp
changed reading of name file to use buffered reads. note the splitAtWhiteSpace functi...
[mothur.git] / deuniqueseqscommand.cpp
index fb02764e93cc8ca2494773aebeccab857e58f378..7481416f649ddad983877ab02cac08e5668316d1 100644 (file)
@@ -36,7 +36,7 @@ string DeUniqueSeqsCommand::getHelpString(){
                helpString += "The deunique.seqs command should be in the following format: \n";
                helpString += "deunique.seqs(fasta=yourFastaFile, name=yourNameFile) \n";       
                helpString += "Example deunique.seqs(fasta=abrecovery.unique.fasta, name=abrecovery.names).\n";
-               helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n";
+               helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n";
                return helpString;
        }
        catch(exception& e) {
@@ -64,6 +64,7 @@ DeUniqueSeqsCommand::DeUniqueSeqsCommand(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();
@@ -113,7 +114,7 @@ DeUniqueSeqsCommand::DeUniqueSeqsCommand(string option)  {
                                fastaFile = m->getFastaFile(); 
                                if (fastaFile != "") { m->mothurOut("Using " + fastaFile + " as input file for the fasta parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("You have no current fastafile and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; }
-                       }       
+                       }else { m->setFastaFile(fastaFile); }   
                        
                        //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"){  
@@ -127,7 +128,7 @@ DeUniqueSeqsCommand::DeUniqueSeqsCommand(string option)  {
                                nameFile = m->getNameFile(); 
                                if (nameFile != "") { m->mothurOut("Using " + nameFile + " as input file for the name parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("You have no current namefile and the name parameter is required."); m->mothurOutEndLine(); abort = true; }
-                       }
+                       }else { m->setNameFile(nameFile); }
                }
 
        }
@@ -154,14 +155,14 @@ int DeUniqueSeqsCommand::execute() {
                m->openOutputFile(outFastaFile, out);
                
                readNamesFile();
-               if (m->control_pressed) {  out.close(); outputTypes.clear(); remove(outFastaFile.c_str()); return 0; }
+               if (m->control_pressed) {  out.close(); outputTypes.clear(); m->mothurRemove(outFastaFile); return 0; }
                
                ifstream in;
                m->openInputFile(fastaFile, in);
                
                while (!in.eof()) {
                
-                       if (m->control_pressed) { in.close(); out.close(); outputTypes.clear(); remove(outFastaFile.c_str()); return 0; }
+                       if (m->control_pressed) { in.close(); out.close(); outputTypes.clear(); m->mothurRemove(outFastaFile); return 0; }
                        
                        Sequence seq(in); m->gobble(in);
                        
@@ -195,7 +196,7 @@ int DeUniqueSeqsCommand::execute() {
                        }
                }
                                
-               if (m->control_pressed) { outputTypes.clear(); remove(outFastaFile.c_str()); return 0; }
+               if (m->control_pressed) { outputTypes.clear(); m->mothurRemove(outFastaFile); return 0; }
                
                m->mothurOutEndLine();
                m->mothurOut("Output File Names: "); m->mothurOutEndLine();