]> git.donarmstrong.com Git - mothur.git/blob - setcurrentcommand.cpp
added uchime_src folder. added biom parameter to make.shared. added biom as a current...
[mothur.git] / setcurrentcommand.cpp
1 /*
2  *  setcurrentcommand.cpp
3  *  Mothur
4  *
5  *  Created by westcott on 3/16/11.
6  *  Copyright 2011 Schloss Lab. All rights reserved.
7  *
8  */
9
10 #include "setcurrentcommand.h"
11
12 //**********************************************************************************************************************
13 vector<string> SetCurrentCommand::setParameters(){      
14         try {
15                 
16                 CommandParameter pprocessors("processors", "Number", "", "1", "", "", "",false,false); parameters.push_back(pprocessors);
17                 CommandParameter pflow("flow", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pflow);
18         CommandParameter pbiom("biom", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pbiom);
19                 CommandParameter pphylip("phylip", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pphylip);
20                 CommandParameter pcolumn("column", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pcolumn);
21                 CommandParameter pfasta("fasta", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pfasta);
22                 CommandParameter pname("name", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pname);
23                 CommandParameter pgroup("group", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pgroup);
24                 CommandParameter plist("list", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(plist);
25                 CommandParameter ptaxonomy("taxonomy", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(ptaxonomy);
26                 CommandParameter pqfile("qfile", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pqfile);
27                 CommandParameter paccnos("accnos", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(paccnos);            
28                 CommandParameter prabund("rabund", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(prabund);
29                 CommandParameter psabund("sabund", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(psabund);
30                 CommandParameter pdesign("design", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pdesign);
31                 CommandParameter porder("order", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(porder);
32                 CommandParameter ptree("tree", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(ptree);
33                 CommandParameter pshared("shared", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pshared);
34                 CommandParameter pordergroup("ordergroup", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pordergroup);
35                 CommandParameter prelabund("relabund", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(prelabund);
36                 CommandParameter psff("sff", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(psff);
37                 CommandParameter poligos("oligos", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(poligos);
38                 CommandParameter pclear("clear", "String", "", "", "", "", "",false,false); parameters.push_back(pclear);
39                 CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir);
40                 CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir);
41                 
42                 vector<string> myArray;
43                 for (int i = 0; i < parameters.size(); i++) {   myArray.push_back(parameters[i].name);          }
44                 return myArray;
45         }
46         catch(exception& e) {
47                 m->errorOut(e, "SetCurrentCommand", "setParameters");
48                 exit(1);
49         }
50 }
51 //**********************************************************************************************************************
52 string SetCurrentCommand::getHelpString(){      
53         try {
54                 string helpString = "";
55                 helpString += "The set.current command allows you to set the current files saved by mothur.\n";
56                 helpString += "The set.current command parameters are: clear, phylip, column, list, rabund, sabund, name, group, design, order, tree, shared, ordergroup, relabund, fasta, qfile, sff, oligos, accnos, biom and taxonomy.\n";
57                 helpString += "The clear paramter is used to indicate which file types you would like to clear values for, multiple types can be separated by dashes.\n";
58                 helpString += "The set.current command should be in the following format: \n";
59                 helpString += "set.current(fasta=yourFastaFile) or set.current(fasta=amazon.fasta, clear=name-accnos)\n";
60                 return helpString;
61         }
62         catch(exception& e) {
63                 m->errorOut(e, "SetCurrentCommand", "getHelpString");
64                 exit(1);
65         }
66 }
67
68
69 //**********************************************************************************************************************
70 SetCurrentCommand::SetCurrentCommand(){ 
71         try {
72                 abort = true; calledHelp = true;
73                 setParameters();
74         }
75         catch(exception& e) {
76                 m->errorOut(e, "SetCurrentCommand", "SetCurrentCommand");
77                 exit(1);
78         }
79 }
80 //**********************************************************************************************************************
81 SetCurrentCommand::SetCurrentCommand(string option)  {
82         try {
83                 abort = false; calledHelp = false;   
84                 
85                 //allow user to run help
86                 if(option == "help") { help(); abort = true; calledHelp = true; }
87                 else if(option == "citation") { citation(); abort = true; calledHelp = true;}
88                 
89                 else {
90                         //valid paramters for this command
91                         vector<string> myArray = setParameters();
92                         
93                         OptionParser parser(option);
94                         map<string,string> parameters = parser.getParameters();
95                         
96                         ValidParameters validParameter;
97                         map<string,string>::iterator it;
98                         //check to make sure all parameters are valid for command
99                         for (it = parameters.begin(); it != parameters.end(); it++) { 
100                                 if (validParameter.isValidParameter(it->first, myArray, it->second) != true) {  abort = true;  }
101                         }
102                         
103                         
104                         //if the user changes the input directory command factory will send this info to us in the output parameter 
105                         string inputDir = validParameter.validFile(parameters, "inputdir", false);              
106                         if (inputDir == "not found"){   inputDir = "";          }
107                         else {
108                                 string path;
109                                 it = parameters.find("phylip");
110                                 //user has given a template file
111                                 if(it != parameters.end()){ 
112                                         path = m->hasPath(it->second);
113                                         //if the user has not given a path then, add inputdir. else leave path alone.
114                                         if (path == "") {       parameters["phylip"] = inputDir + it->second;           }
115                                 }
116                                 
117                                 it = parameters.find("column");
118                                 //user has given a template file
119                                 if(it != parameters.end()){ 
120                                         path = m->hasPath(it->second);
121                                         //if the user has not given a path then, add inputdir. else leave path alone.
122                                         if (path == "") {       parameters["column"] = inputDir + it->second;           }
123                                 }
124                                 
125                                 it = parameters.find("fasta");
126                                 //user has given a template file
127                                 if(it != parameters.end()){ 
128                                         path = m->hasPath(it->second);
129                                         //if the user has not given a path then, add inputdir. else leave path alone.
130                                         if (path == "") {       parameters["fasta"] = inputDir + it->second;            }
131                                 }
132                                 
133                                 it = parameters.find("list");
134                                 //user has given a template file
135                                 if(it != parameters.end()){ 
136                                         path = m->hasPath(it->second);
137                                         //if the user has not given a path then, add inputdir. else leave path alone.
138                                         if (path == "") {       parameters["list"] = inputDir + it->second;             }
139                                 }
140                                 
141                                 it = parameters.find("rabund");
142                                 //user has given a template file
143                                 if(it != parameters.end()){ 
144                                         path = m->hasPath(it->second);
145                                         //if the user has not given a path then, add inputdir. else leave path alone.
146                                         if (path == "") {       parameters["rabund"] = inputDir + it->second;           }
147                                 }
148                                 
149                                 it = parameters.find("sabund");
150                                 //user has given a template file
151                                 if(it != parameters.end()){ 
152                                         path = m->hasPath(it->second);
153                                         //if the user has not given a path then, add inputdir. else leave path alone.
154                                         if (path == "") {       parameters["sabund"] = inputDir + it->second;           }
155                                 }
156                                 
157                                 it = parameters.find("name");
158                                 //user has given a template file
159                                 if(it != parameters.end()){ 
160                                         path = m->hasPath(it->second);
161                                         //if the user has not given a path then, add inputdir. else leave path alone.
162                                         if (path == "") {       parameters["name"] = inputDir + it->second;             }
163                                 }
164                                 
165                                 it = parameters.find("group");
166                                 //user has given a template file
167                                 if(it != parameters.end()){ 
168                                         path = m->hasPath(it->second);
169                                         //if the user has not given a path then, add inputdir. else leave path alone.
170                                         if (path == "") {       parameters["group"] = inputDir + it->second;            }
171                                 }
172                                 
173                                 it = parameters.find("design");
174                                 //user has given a template file
175                                 if(it != parameters.end()){ 
176                                         path = m->hasPath(it->second);
177                                         //if the user has not given a path then, add inputdir. else leave path alone.
178                                         if (path == "") {       parameters["design"] = inputDir + it->second;           }
179                                 }
180                                 
181                                 it = parameters.find("order");
182                                 //user has given a template file
183                                 if(it != parameters.end()){ 
184                                         path = m->hasPath(it->second);
185                                         //if the user has not given a path then, add inputdir. else leave path alone.
186                                         if (path == "") {       parameters["order"] = inputDir + it->second;            }
187                                 }
188                                 
189                                 it = parameters.find("tree");
190                                 //user has given a template file
191                                 if(it != parameters.end()){ 
192                                         path = m->hasPath(it->second);
193                                         //if the user has not given a path then, add inputdir. else leave path alone.
194                                         if (path == "") {       parameters["tree"] = inputDir + it->second;             }
195                                 }
196                                 
197                                 it = parameters.find("shared");
198                                 //user has given a template file
199                                 if(it != parameters.end()){ 
200                                         path = m->hasPath(it->second);
201                                         //if the user has not given a path then, add inputdir. else leave path alone.
202                                         if (path == "") {       parameters["shared"] = inputDir + it->second;           }
203                                 }
204                                 
205                                 it = parameters.find("ordergroup");
206                                 //user has given a template file
207                                 if(it != parameters.end()){ 
208                                         path = m->hasPath(it->second);
209                                         //if the user has not given a path then, add inputdir. else leave path alone.
210                                         if (path == "") {       parameters["ordergroup"] = inputDir + it->second;               }
211                                 }
212                                 
213                                 it = parameters.find("relabund");
214                                 //user has given a template file
215                                 if(it != parameters.end()){ 
216                                         path = m->hasPath(it->second);
217                                         //if the user has not given a path then, add inputdir. else leave path alone.
218                                         if (path == "") {       parameters["relabund"] = inputDir + it->second;         }
219                                 }
220                                 
221                                 it = parameters.find("fasta");
222                                 //user has given a template file
223                                 if(it != parameters.end()){ 
224                                         path = m->hasPath(it->second);
225                                         //if the user has not given a path then, add inputdir. else leave path alone.
226                                         if (path == "") {       parameters["fasta"] = inputDir + it->second;            }
227                                 }
228                                 
229                                 it = parameters.find("qfile");
230                                 //user has given a template file
231                                 if(it != parameters.end()){ 
232                                         path = m->hasPath(it->second);
233                                         //if the user has not given a path then, add inputdir. else leave path alone.
234                                         if (path == "") {       parameters["qfile"] = inputDir + it->second;            }
235                                 }
236                                 
237                                 it = parameters.find("sff");
238                                 //user has given a template file
239                                 if(it != parameters.end()){ 
240                                         path = m->hasPath(it->second);
241                                         //if the user has not given a path then, add inputdir. else leave path alone.
242                                         if (path == "") {       parameters["sff"] = inputDir + it->second;              }
243                                 }
244                                 
245                                 it = parameters.find("oligos");
246                                 //user has given a template file
247                                 if(it != parameters.end()){ 
248                                         path = m->hasPath(it->second);
249                                         //if the user has not given a path then, add inputdir. else leave path alone.
250                                         if (path == "") {       parameters["oligos"] = inputDir + it->second;           }
251                                 }
252                                 
253                                 it = parameters.find("accnos");
254                                 //user has given a template file
255                                 if(it != parameters.end()){ 
256                                         path = m->hasPath(it->second);
257                                         //if the user has not given a path then, add inputdir. else leave path alone.
258                                         if (path == "") {       parameters["accnos"] = inputDir + it->second;           }
259                                 }
260
261                                 it = parameters.find("taxonomy");
262                                 //user has given a template file
263                                 if(it != parameters.end()){ 
264                                         path = m->hasPath(it->second);
265                                         //if the user has not given a path then, add inputdir. else leave path alone.
266                                         if (path == "") {       parameters["taxonomy"] = inputDir + it->second;         }
267                                 }
268                                 
269                                 it = parameters.find("flow");
270                                 //user has given a template file
271                                 if(it != parameters.end()){ 
272                                         path = m->hasPath(it->second);
273                                         //if the user has not given a path then, add inputdir. else leave path alone.
274                                         if (path == "") {       parameters["flow"] = inputDir + it->second;             }
275                                 }
276                 
277                 it = parameters.find("biom");
278                                 //user has given a template file
279                                 if(it != parameters.end()){ 
280                                         path = m->hasPath(it->second);
281                                         //if the user has not given a path then, add inputdir. else leave path alone.
282                                         if (path == "") {       parameters["biom"] = inputDir + it->second;             }
283                                 }
284                         }
285                         
286                         //check for parameters
287                         phylipfile = validParameter.validFile(parameters, "phylip", true);
288                         if (phylipfile == "not open") { m->mothurOut("Ignoring: " + parameters["phylip"]); m->mothurOutEndLine(); phylipfile = ""; }
289                         else if (phylipfile == "not found") {  phylipfile = "";  }      
290                         if (phylipfile != "") { m->setPhylipFile(phylipfile); }
291                         
292                         columnfile = validParameter.validFile(parameters, "column", true);
293                         if (columnfile == "not open") { m->mothurOut("Ignoring: " + parameters["column"]); m->mothurOutEndLine(); columnfile = ""; }
294                         else if (columnfile == "not found") {  columnfile = "";  }      
295                         if (columnfile != "") { m->setColumnFile(columnfile); }
296                         
297                         listfile = validParameter.validFile(parameters, "list", true);
298                         if (listfile == "not open") { m->mothurOut("Ignoring: " + parameters["list"]); m->mothurOutEndLine(); listfile = ""; }
299                         else if (listfile == "not found") {  listfile = "";  }  
300                         if (listfile != "") { m->setListFile(listfile); }
301                         
302                         rabundfile = validParameter.validFile(parameters, "rabund", true);
303                         if (rabundfile == "not open") { m->mothurOut("Ignoring: " + parameters["rabund"]); m->mothurOutEndLine(); rabundfile = ""; }
304                         else if (rabundfile == "not found") {  rabundfile = "";  }      
305                         if (rabundfile != "") { m->setRabundFile(rabundfile); }
306                         
307                         sabundfile = validParameter.validFile(parameters, "sabund", true);
308                         if (sabundfile == "not open") { m->mothurOut("Ignoring: " + parameters["sabund"]); m->mothurOutEndLine(); sabundfile = ""; }
309                         else if (sabundfile == "not found") {  sabundfile = "";  }      
310                         if (sabundfile != "") { m->setSabundFile(sabundfile); }
311                         
312                         namefile = validParameter.validFile(parameters, "name", true);
313                         if (namefile == "not open") { m->mothurOut("Ignoring: " + parameters["name"]); m->mothurOutEndLine(); namefile = ""; }
314                         else if (namefile == "not found") {  namefile = "";  }  
315                         if (namefile != "") { m->setNameFile(namefile); }
316                         
317                         groupfile = validParameter.validFile(parameters, "group", true);
318                         if (groupfile == "not open") { m->mothurOut("Ignoring: " + parameters["group"]); m->mothurOutEndLine(); groupfile = ""; }
319                         else if (groupfile == "not found") {  groupfile = "";  }
320                         if (groupfile != "") { m->setGroupFile(groupfile); }
321                         
322                         designfile = validParameter.validFile(parameters, "design", true);
323                         if (designfile == "not open") { m->mothurOut("Ignoring: " + parameters["design"]); m->mothurOutEndLine(); designfile = ""; }
324                         else if (designfile == "not found") {  designfile = "";  }      
325                         if (designfile != "") { m->setDesignFile(designfile); }
326                         
327                         orderfile = validParameter.validFile(parameters, "order", true);
328                         if (orderfile == "not open") { m->mothurOut("Ignoring: " + parameters["order"]); m->mothurOutEndLine(); orderfile = ""; }
329                         else if (orderfile == "not found") {  orderfile = "";  }
330                         if (orderfile != "") { m->setOrderFile(orderfile); }
331                         
332                         treefile = validParameter.validFile(parameters, "tree", true);
333                         if (treefile == "not open") { m->mothurOut("Ignoring: " + parameters["tree"]); m->mothurOutEndLine(); treefile = ""; }
334                         else if (treefile == "not found") {  treefile = "";  }  
335                         if (treefile != "") { m->setTreeFile(treefile); }
336                         
337                         sharedfile = validParameter.validFile(parameters, "shared", true);
338                         if (sharedfile == "not open") { m->mothurOut("Ignoring: " + parameters["shared"]); m->mothurOutEndLine(); sharedfile = ""; }
339                         else if (sharedfile == "not found") {  sharedfile = "";  }      
340                         if (sharedfile != "") { m->setSharedFile(sharedfile); }
341                         
342                         ordergroupfile = validParameter.validFile(parameters, "ordergroup", true);
343                         if (ordergroupfile == "not open") { m->mothurOut("Ignoring: " + parameters["ordergroup"]); m->mothurOutEndLine(); ordergroupfile = ""; }
344                         else if (ordergroupfile == "not found") {  ordergroupfile = "";  }      
345                         if (ordergroupfile != "") { m->setOrderGroupFile(ordergroupfile); }
346                         
347                         relabundfile = validParameter.validFile(parameters, "relabund", true);
348                         if (relabundfile == "not open") { m->mothurOut("Ignoring: " + parameters["relabund"]); m->mothurOutEndLine(); relabundfile = ""; }
349                         else if (relabundfile == "not found") {  relabundfile = "";  }  
350                         if (relabundfile != "") { m->setRelAbundFile(relabundfile); }
351                         
352                         fastafile = validParameter.validFile(parameters, "fasta", true);
353                         if (fastafile == "not open") { m->mothurOut("Ignoring: " + parameters["fasta"]); m->mothurOutEndLine(); fastafile = ""; }
354                         else if (fastafile == "not found") {  fastafile = "";  }
355                         if (fastafile != "") { m->setFastaFile(fastafile); }
356                         
357                         qualfile = validParameter.validFile(parameters, "qfile", true);
358                         if (qualfile == "not open") { m->mothurOut("Ignoring: " + parameters["qfile"]); m->mothurOutEndLine(); qualfile = ""; }
359                         else if (qualfile == "not found") {  qualfile = "";  }  
360                         if (qualfile != "") { m->setQualFile(qualfile); }
361                         
362                         sfffile = validParameter.validFile(parameters, "sff", true);
363                         if (sfffile == "not open") { m->mothurOut("Ignoring: " + parameters["sff"]); m->mothurOutEndLine(); sfffile = ""; }
364                         else if (sfffile == "not found") {  sfffile = "";  }    
365                         if (sfffile != "") { m->setSFFFile(sfffile); }
366                         
367                         oligosfile = validParameter.validFile(parameters, "oligos", true);
368                         if (oligosfile == "not open") { m->mothurOut("Ignoring: " + parameters["oligos"]); m->mothurOutEndLine(); oligosfile = ""; }
369                         else if (oligosfile == "not found") {  oligosfile = "";  }      
370                         if (oligosfile != "") { m->setOligosFile(oligosfile); }
371                         
372                         accnosfile = validParameter.validFile(parameters, "accnos", true);
373                         if (accnosfile == "not open") { m->mothurOut("Ignoring: " + parameters["accnos"]); m->mothurOutEndLine(); accnosfile = ""; }
374                         else if (accnosfile == "not found") {  accnosfile = "";  }      
375                         if (accnosfile != "") { m->setAccnosFile(accnosfile); }
376                         
377                         taxonomyfile = validParameter.validFile(parameters, "taxonomy", true);
378                         if (taxonomyfile == "not open") { m->mothurOut("Ignoring: " + parameters["taxonomy"]); m->mothurOutEndLine(); taxonomyfile = ""; }
379                         else if (taxonomyfile == "not found") {  taxonomyfile = "";  }  
380                         if (taxonomyfile != "") { m->setTaxonomyFile(taxonomyfile); }
381                         
382                         flowfile = validParameter.validFile(parameters, "flow", true);
383                         if (flowfile == "not open") { m->mothurOut("Ignoring: " + parameters["flow"]); m->mothurOutEndLine(); flowfile = ""; }
384                         else if (flowfile == "not found") {  flowfile = "";  }  
385                         if (flowfile != "") { m->setFlowFile(flowfile); }
386             
387             biomfile = validParameter.validFile(parameters, "biom", true);
388                         if (biomfile == "not open") { m->mothurOut("Ignoring: " + parameters["biom"]); m->mothurOutEndLine(); biomfile = ""; }
389                         else if (biomfile == "not found") {  biomfile = "";  }  
390                         if (biomfile != "") { m->setBiomFile(biomfile); }
391                         
392                         processors = validParameter.validFile(parameters, "processors", false);
393                         if (processors == "not found") {  processors = "1";  }  
394                         if (processors != "") { m->setProcessors(processors); }
395                         
396                         clearTypes = validParameter.validFile(parameters, "clear", false);                      
397                         if (clearTypes == "not found") { clearTypes = ""; }
398                         else { m->splitAtDash(clearTypes, types);       }
399                 }
400                 
401         }
402         catch(exception& e) {
403                 m->errorOut(e, "SetCurrentCommand", "SetCurrentCommand");
404                 exit(1);
405         }
406 }
407 //**********************************************************************************************************************
408
409 int SetCurrentCommand::execute(){
410         try {
411                 
412                 if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
413                 
414                 //user wants to clear a type
415                 if (types.size() != 0) {
416                         for (int i = 0; i < types.size(); i++) {
417                                 
418                                 if (m->control_pressed) { break; }
419                                 
420                                 //look for file types
421                                 if (types[i] == "fasta") {
422                                         m->setFastaFile("");
423                                 }else if (types[i] == "qfile") {
424                                         m->setQualFile("");
425                                 }else if (types[i] == "phylip") {
426                                         m->setPhylipFile("");
427                                 }else if (types[i] == "column") {
428                                         m->setColumnFile("");
429                                 }else if (types[i] == "list") {
430                                         m->setListFile("");
431                                 }else if (types[i] == "rabund") {
432                                         m->setRabundFile("");
433                                 }else if (types[i] == "sabund") {
434                                         m->setSabundFile("");
435                                 }else if (types[i] == "name") {
436                                         m->setNameFile("");
437                                 }else if (types[i] == "group") {
438                                         m->setGroupFile("");
439                                 }else if (types[i] == "order") {
440                                         m->setOrderFile("");
441                                 }else if (types[i] == "ordergroup") {
442                                         m->setOrderGroupFile("");
443                                 }else if (types[i] == "tree") {
444                                         m->setTreeFile("");
445                                 }else if (types[i] == "shared") {
446                                         m->setSharedFile("");
447                                 }else if (types[i] == "relabund") {
448                                         m->setRelAbundFile("");
449                                 }else if (types[i] == "design") {
450                                         m->setDesignFile("");
451                                 }else if (types[i] == "sff") {
452                                         m->setSFFFile("");
453                                 }else if (types[i] == "oligos") {
454                                         m->setOligosFile("");
455                                 }else if (types[i] == "accnos") {
456                                         m->setAccnosFile("");
457                                 }else if (types[i] == "taxonomy") {
458                                         m->setTaxonomyFile("");
459                                 }else if (types[i] == "flow") {
460                                         m->setFlowFile("");
461                 }else if (types[i] == "biom") {
462                                         m->setBiomFile("");
463                                 }else if (types[i] == "processors") {
464                                         m->setProcessors("1");
465                                 }else if (types[i] == "all") {
466                                         m->clearCurrentFiles();
467                                 }else {
468                                         m->mothurOut("[ERROR]: mothur does not save a current file for " + types[i]); m->mothurOutEndLine();
469                                 }
470                         }
471                 }
472                 
473                 m->mothurOutEndLine(); m->mothurOut("Current files saved by mothur:"); m->mothurOutEndLine();
474                 m->printCurrentFiles();
475                 
476                 return 0;       
477         }
478         
479         catch(exception& e) {
480                 m->errorOut(e, "SetCurrentCommand", "execute");
481                 exit(1);
482         }
483 }
484
485 //**********************************************************************************************************************
486
487
488