AlignCommand::AlignCommand(string option) {
try {
abort = false; calledHelp = false;
+ currentFiles = CurrentFile::getInstance();
//allow user to run help
if(option == "help") { help(); abort = true; calledHelp = true;}
#include "database.hpp"
#include "alignment.hpp"
#include "alignmentdb.h"
+#include "mothurfiles.h"
class AlignCommand : public Command {
vector<string> outputNames;
bool abort, flip, calledHelp;
+ CurrentFile* currentFiles;
};
phylipFileName = "";
//check currentFiles for a phylip file
- if (currentFiles->getPhylipFile() != "") { phylipFileName = currentFiles->getPhylipFile(); m->mothurOut("Using " + phylipFileName + " as phylip file."); m->mothurOutEndLine();
- }else { m->mothurOut("You must provide an phylip file."); m->mothurOutEndLine(); abort = true; }
+ //if (currentFiles->getPhylipFile() != "") { phylipFileName = currentFiles->getPhylipFile(); m->mothurOut("Using " + phylipFileName + " as phylip file."); m->mothurOutEndLine();
+ //}else { m->mothurOut("You must provide an phylip file."); m->mothurOutEndLine(); abort = true; }
}
//check for required parameters
designFileName = "";
//check currentFiles for a design file
- if (currentFiles->getDesignFile() != "") { designFileName = currentFiles->getPhylipFile(); m->mothurOut("Using " + designFileName + " as phylip file."); m->mothurOutEndLine();
- }else { m->mothurOut("You must provide an design file."); m->mothurOutEndLine(); abort = true; }
+ //if (currentFiles->getDesignFile() != "") { designFileName = currentFiles->getDesignFile(); m->mothurOut("Using " + designFileName + " as design file."); m->mothurOutEndLine();
+ //}else { m->mothurOut("You must provide an design file."); m->mothurOutEndLine(); abort = true; }
}
string temp = validParameter.validFile(parameters, "iters", false);
phylipFileName = validParameter.validFile(parameters, "phylip", true);
if (phylipFileName == "not open") { phylipFileName = ""; abort = true; }
- else if (phylipFileName == "not found") { phylipFileName = ""; }
- else if (designFileName == "not found") {
- designFileName = "";
- m->mothurOut("You must provide an phylip file.");
- m->mothurOutEndLine();
- abort = true;
+ else if (phylipFileName == "not found") {
+ phylipFileName = "";
+
+ //check currentFiles for a phylip file
+ //if (currentFiles->getPhylipFile() != "") { phylipFileName = currentFiles->getPhylipFile(); m->mothurOut("Using " + phylipFileName + " as phylip file."); m->mothurOutEndLine();
+ //}else { m->mothurOut("You must provide an phylip file."); m->mothurOutEndLine(); abort = true; }
}
//check for required parameters
if (designFileName == "not open") { abort = true; }
else if (designFileName == "not found") {
designFileName = "";
- m->mothurOut("You must provide an design file.");
- m->mothurOutEndLine();
- abort = true;
+
+ //check currentFiles for a design file
+ //if (currentFiles->getDesignFile() != "") { designFileName = currentFiles->getDesignFile(); m->mothurOut("Using " + designFileName + " as design file."); m->mothurOutEndLine();
+ //}else { m->mothurOut("You must provide an design file."); m->mothurOutEndLine(); abort = true; }
+
}
string temp = validParameter.validFile(parameters, "iters", false);
#include "optionparser.h"
#include "validparameter.h"
#include "mothurout.h"
-#include "currentfile.h"
class Command {
public:
- Command() { m = MothurOut::getInstance(); currentFiles = CurrentFile::getInstance(); }
+ Command() { m = MothurOut::getInstance(); }
virtual vector<string> getValidParameters() = 0;
virtual vector<string> getRequiredParameters() = 0; //adding "or" as the last element indicates one of the previous is needed
virtual vector<string> getRequiredFiles() = 0; //adding "or" as the last element indicates one of the previous is needed
virtual ~Command() { }
protected:
MothurOut* m;
- CurrentFile* currentFiles;
+
bool calledHelp;
map<string, vector<string> >::iterator itTypes;
}
/*********************************************************************************************/
CurrentFile::CurrentFile() {
+ m = MothurOut::getInstance();
+
phylipfile = "";
columnfile = "";
listfile = "";
*
*/
+#include "mothurout.h"
#include "mothur.h"
/***********************************************/
string getOligosFile() { return oligosfile; }
- void setListFile(string f) { listfile = f; }
- void setTreeFile(string f) { treefile = f; }
- void setGroupFile(string f) { groupfile = f; }
- void setPhylipFile(string f) { phylipfile = f; }
- void setColumnFile(string f) { columnfile = f; }
- void setNameFile(string f) { namefile = f; }
- void setRabundFile(string f) { rabundfile = f; }
- void setSabundFile(string f) { sabundfile = f; }
- void setSharedFile(string f) { sharedfile = f; }
- void setRelAbundFile(string f) { relabundfile = f; }
- void setOrderFile(string f) { orderfile = f; }
- void setOrderGroupFile(string f) { ordergroupfile = f; }
- void setDesignFile(string f) { designfile = f; }
- void setFastaFile(string f) { fastafile = f; }
- void setSFFFile(string f) { sfffile = f; }
- void setQualFile(string f) { qualfile = f; }
- void setOligosFile(string f) { oligosfile = f; }
+ void setListFile(string f) { listfile = m->getFullPathName(f); }
+ void setTreeFile(string f) { treefile = m->getFullPathName(f); }
+ void setGroupFile(string f) { groupfile = m->getFullPathName(f); }
+ void setPhylipFile(string f) { phylipfile = m->getFullPathName(f); }
+ void setColumnFile(string f) { columnfile = m->getFullPathName(f); }
+ void setNameFile(string f) { namefile = m->getFullPathName(f); }
+ void setRabundFile(string f) { rabundfile = m->getFullPathName(f); }
+ void setSabundFile(string f) { sabundfile = m->getFullPathName(f); }
+ void setSharedFile(string f) { sharedfile = m->getFullPathName(f); }
+ void setRelAbundFile(string f) { relabundfile = m->getFullPathName(f); }
+ void setOrderFile(string f) { orderfile = m->getFullPathName(f); }
+ void setOrderGroupFile(string f) { ordergroupfile = m->getFullPathName(f); }
+ void setDesignFile(string f) { designfile = m->getFullPathName(f); }
+ void setFastaFile(string f) { fastafile = m->getFullPathName(f); }
+ void setSFFFile(string f) { sfffile = m->getFullPathName(f); }
+ void setQualFile(string f) { qualfile = m->getFullPathName(f); }
+ void setOligosFile(string f) { oligosfile = m->getFullPathName(f); }
private:
+
static CurrentFile* _uniqueInstance;
CurrentFile( const CurrentFile& ); // Disable copy constructor
void operator=( const CurrentFile& ); // Disable assignment operator
CurrentFile();
~CurrentFile();
+ MothurOut* m;
string phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, designfile;
string orderfile, treefile, sharedfile, ordergroupfile, relabundfile, fastafile, qualfile, sfffile, oligosfile;