]> git.donarmstrong.com Git - mothur.git/commitdiff
added remove file option to pipeline command in user mode
authorwestcott <westcott>
Mon, 25 Oct 2010 14:54:52 +0000 (14:54 +0000)
committerwestcott <westcott>
Mon, 25 Oct 2010 14:54:52 +0000 (14:54 +0000)
Mothur.xcodeproj/project.pbxproj
mothur
pipelinepdscommand.cpp
pipelinepdscommand.h

index 2ef7f2ba0141e2eaf85c07abf121b318c6434082..4a328a3bca837ad2b90ef16b0722aa5bdad21d30 100644 (file)
                        };
                        buildConfigurationList = 1DEB919308733D9F0010E9CD /* Build configuration list for PBXProject "Mothur" */;
                        compatibilityVersion = "Xcode 3.0";
+                       developmentRegion = English;
                        hasScannedForEncodings = 1;
+                       knownRegions = (
+                               English,
+                               Japanese,
+                               French,
+                               German,
+                       );
                        mainGroup = 08FB7794FE84155DC02AAC07 /* mothur */;
                        projectDirPath = "";
                        projectRoot = "";
diff --git a/mothur b/mothur
index a29d1c921ddf4ac19cc9bd424dd210a8e973e05a..1255e3acd4e73f2c99d45e4b5787783daf36800d 100755 (executable)
Binary files a/mothur and b/mothur differ
index 2bbf2234e6a1e99cf0c15975c54eba842281fe84..d928122787c965beafb78b12eb42b901367a4eb9 100644 (file)
@@ -356,6 +356,8 @@ bool PipelineCommand::parseCommand(string nextCommand, string& name, string& opt
 bool PipelineCommand::checkForValidAndRequiredParameters(string name, string options, map<string, vector<string> >& mothurMadeFiles){
        try {
                
+               if (name == "system") { return false; }
+               
                //get shell of the command so we can check to make sure its valid without running it
                Command* command = cFactory->getCommand(name);
                
@@ -528,7 +530,7 @@ int PipelineCommand::runUsersPipeline(){
        }
 }
 //**********************************************************************************************************************
-bool PipelineCommand::fillInMothurMade(string& options, map<string, vector<string> > mothurMadeFiles){
+bool PipelineCommand::fillInMothurMade(string& options, map<string, vector<string> >& mothurMadeFiles){
        try {
                OptionParser parser(options);
                map<string, string> parameters = parser.getParameters(); 
@@ -540,8 +542,9 @@ bool PipelineCommand::fillInMothurMade(string& options, map<string, vector<strin
                //fill in mothurmade filenames
                for (it = parameters.begin(); it != parameters.end(); it++) { 
                        string paraType = it->first;
+                       string tempOption = it->second;
                        
-                       if (it->second == "mothurmade") {
+                       if (tempOption == "mothurmade") {
                                
                                if (it->first == "candidate") { paraType = "fasta"; }
                        
@@ -559,6 +562,7 @@ bool PipelineCommand::fillInMothurMade(string& options, map<string, vector<strin
                                                for (int i = 0; i < temp.size(); i++) {
                                                        m->mothurOut(toString(i) + " - " + temp[i]); m->mothurOutEndLine();
                                                }
+                                               
                                                m->mothurOut("Please select the number of the file you would like to use: ");
                                                int num = 0;
                                                cin >> num;
@@ -566,23 +570,43 @@ bool PipelineCommand::fillInMothurMade(string& options, map<string, vector<strin
                                                
                                                if ((num < 0) || (num > (temp.size()-1))) { m->mothurOut("Not a valid response, quitting."); m->mothurOutEndLine(); return true; }
                                                else {
-                                                       parameters[paraType] = temp[num];
+                                                       tempOption = temp[num];
                                                }
                                
                                                //clears buffer so next command doesn't have error
                                                string s;       
                                                getline(cin, s);
                                                
+                                               vector<string> newTemp;
+                                               for (int i = 0; i < temp.size(); i++) {
+                                                       if (i == num) { newTemp.push_back(temp[i]); }
+                                                       else {
+                                                               m->mothurOut("Would you like to remove " + temp[i] + " as an option for " + paraType + ", (y/n): "); m->mothurOutEndLine();
+                                                               string response;
+                                                               cin >> response;
+                                                               m->mothurOutJustToLog(response); m->mothurOutEndLine();
+                                                       
+                                                               if (response == "n") {  newTemp.push_back(temp[i]); }
+                                                       
+                                                               //clears buffer so next command doesn't have error
+                                                               string s;       
+                                                               getline(cin, s);
+                                                       }
+                                               }
+                                               
+                                               mothurMadeFiles[paraType] = newTemp;
+                                               
+                                               
                                        }else if (temp.size() == 0){
                                                m->mothurOut("Sorry, we seem to think you created a " + paraType + " file, but it seems mothur doesn't have a filename."); m->mothurOutEndLine();
                                                return true;
                                        }else{
-                                               parameters[paraType] = temp[0];
+                                               tempOption = temp[0];
                                        }
                                }
                        }
                        
-                       options += it->first + "=" + parameters[paraType] + ", ";
+                       options += it->first + "=" + tempOption + ", ";
                }
                
                //rip off extra comma
index 8a8a195eef38c9787332c2b029c889f693c55639..a5061599472400895d1dfc1fac41320f7a880864 100644 (file)
@@ -43,7 +43,7 @@ private:
        void createPatsPipeline();
        bool parseCommand(string, string&, string&);
        bool checkForValidAndRequiredParameters(string, string, map<string, vector<string> >&);
-       bool fillInMothurMade(string&, map<string, vector<string> >);
+       bool fillInMothurMade(string&, map<string, vector<string> >&);
 };
 
 /****************************************************/