]> git.donarmstrong.com Git - mothur.git/blobdiff - reversecommand.cpp
added set.current and get.current commands and modified existing commands to update...
[mothur.git] / reversecommand.cpp
index 5eceb3049f0d6cbc41025c875843adce306a745c..fffe8a2b9de510bead87e0c9762cf75f71af8ef3 100644 (file)
@@ -181,7 +181,7 @@ int ReverseSeqsCommand::execute(){
                        }
                        inFASTA.close();
                        outFASTA.close();
-                       outputNames.push_back(fastaReverseFileName);
+                       outputNames.push_back(fastaReverseFileName); outputTypes["fasta"].push_back(fastaReverseFileName);
                }
                
                string qualReverseFileName;
@@ -204,9 +204,24 @@ int ReverseSeqsCommand::execute(){
                        }
                        inQual.close();
                        outQual.close();
-                       outputNames.push_back(qualReverseFileName);
+                       outputNames.push_back(qualReverseFileName); outputTypes["qfile"].push_back(qualReverseFileName);
                }
                
+               if (m->control_pressed) {  remove(qualReverseFileName.c_str()); remove(fastaReverseFileName.c_str()); return 0; }
+               
+               //set fasta file as new current fastafile
+               string current = "";
+               itTypes = outputTypes.find("fasta");
+               if (itTypes != outputTypes.end()) {
+                       if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setFastaFile(current); }
+               }
+               
+               itTypes = outputTypes.find("qfile");
+               if (itTypes != outputTypes.end()) {
+                       if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setQualFile(current); }
+               }
+               
+               
                m->mothurOutEndLine();
                m->mothurOut("Output File Name: "); m->mothurOutEndLine();
                for(int i=0;i<outputNames.size();i++){
@@ -214,6 +229,8 @@ int ReverseSeqsCommand::execute(){
                        m->mothurOutEndLine();
                }
                
+               
+               
                return 0;
        }
        catch(exception& e) {