//**********************************************************************************************************************
vector<string> SensSpecCommand::setParameters(){
try {
- CommandParameter plist("list", "InputTypes", "", "", "none", "none", "none",false,true); parameters.push_back(plist);
- CommandParameter pphylip("phylip", "InputTypes", "", "", "PhylipColumn", "PhylipColumn", "none",false,false); parameters.push_back(pphylip);
- //CommandParameter pname("name", "InputTypes", "", "", "none", "none", "ColumnName",false,false); parameters.push_back(pname);
- CommandParameter pcolumn("column", "InputTypes", "", "", "PhylipColumn", "PhylipColumn", "none",false,false); parameters.push_back(pcolumn);
- CommandParameter plabel("label", "String", "", "", "", "", "",false,false); parameters.push_back(plabel);
- CommandParameter pcutoff("cutoff", "Number", "", "-1.00", "", "", "",false,false); parameters.push_back(pcutoff);
- CommandParameter pprecision("precision", "Number", "", "100", "", "", "",false,false); parameters.push_back(pprecision);
- CommandParameter phard("hard", "Boolean", "", "F", "", "", "",false,false); parameters.push_back(phard);
- CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir);
- CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir);
+ CommandParameter plist("list", "InputTypes", "", "", "none", "none", "none","sensspec",false,true,true); parameters.push_back(plist);
+ CommandParameter pphylip("phylip", "InputTypes", "", "", "PhylipColumn", "PhylipColumn", "none","",false,false); parameters.push_back(pphylip);
+ CommandParameter pcolumn("column", "InputTypes", "", "", "PhylipColumn", "PhylipColumn", "none","",false,false); parameters.push_back(pcolumn);
+ CommandParameter plabel("label", "String", "", "", "", "", "","",false,false); parameters.push_back(plabel);
+ CommandParameter pcutoff("cutoff", "Number", "", "-1.00", "", "", "","",false,false); parameters.push_back(pcutoff);
+ CommandParameter pprecision("precision", "Number", "", "100", "", "", "","",false,false); parameters.push_back(pprecision);
+ CommandParameter phard("hard", "Boolean", "", "T", "", "", "","",false,false); parameters.push_back(phard);
+ CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir);
+ CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir);
vector<string> myArray;
for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); }
}
}
//**********************************************************************************************************************
+string SensSpecCommand::getOutputPattern(string type) {
+ try {
+ string pattern = "";
+
+ if (type == "sensspec") { pattern = "[filename],sensspec"; }
+ else { m->mothurOut("[ERROR]: No definition for type " + type + " output pattern.\n"); m->control_pressed = true; }
+
+ return pattern;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SensSpecCommand", "getOutputPattern");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
SensSpecCommand::SensSpecCommand(){
try {
abort = true; calledHelp = true;
path = m->hasPath(it->second);
//if the user has not given a path then, add inputdir. else leave path alone.
if (path == "") { parameters["column"] = inputDir + it->second; }
- }
-
- //it = parameters.find("name");
- //user has given a template file
- //if(it != parameters.end()){
- //path = m->hasPath(it->second);
- //if the user has not given a path then, add inputdir. else leave path alone.
- //if (path == "") { parameters["name"] = inputDir + it->second; }
- //}
-
+ }
}
//check for required parameters
listFile = validParameter.validFile(parameters, "list", true);
else if(!m->isTrue(temp)) { hard = 0; }
else if(m->isTrue(temp)) { hard = 1; }
-// temp = validParameter.validFile(parameters, "name", true);
-// if (temp == "not found") { nameFile = ""; }
-// else if(temp == "not open") { abort = true; }
-// else { nameFile = temp; }
-// cout << "name:\t" << nameFile << endl;
-
temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { temp = "-1.00"; }
- convert(temp, cutoff);
+ m->mothurConvert(temp, cutoff);
// cout << cutoff << endl;
temp = validParameter.validFile(parameters, "precision", false); if (temp == "not found") { temp = "100"; }
- convert(temp, precision);
+ m->mothurConvert(temp, precision);
// cout << precision << endl;
string label = validParameter.validFile(parameters, "label", false);
else { allLines = 1; }
}
- sensSpecFileName = outputDir + m->getRootName(m->getSimpleName(listFile)) + "sensspec";
+ map<string, string> variables;
+ variables["[filename]"] = outputDir + m->getRootName(m->getSimpleName(listFile));
+ sensSpecFileName = getOutputFileName("sensspec",variables);
}
}
catch(exception& e) {
if (m->control_pressed) { m->mothurRemove(sensSpecFileName); return 0; }
m->mothurOutEndLine();
- m->mothurOut("Output File Name: "); m->mothurOutEndLine();
+ m->mothurOut("Output File Names: "); m->mothurOutEndLine();
m->mothurOut(sensSpecFileName); m->mothurOutEndLine();
m->mothurOutEndLine();
while((list != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } delete list; return 0; }
+ if(m->control_pressed){
+ for (int i = 0; i < outputNames.size(); i++){ m->mothurRemove(outputNames[i]); } delete list; return 0;
+ }
if(allLines == 1 || labels.count(list->getLabel()) == 1){
exit(1);
}
}
+
//***************************************************************************************************************
+
int SensSpecCommand::fillSeqMap(map<string, int>& seqMap, ListVector*& list){
try {
//for each otu
return numSeqs;
}
catch(exception& e) {
- m->errorOut(e, "SensSpecCommand", "fillSeqMap");
+ m->errorOut(e, "SensSpecCommand", "fillSeqPairSet");
exit(1);
}
}
ifstream phylipFile;
m->openInputFile(distFile, phylipFile);
phylipFile >> pNumSeqs;
- if(pNumSeqs != lNumSeqs){ m->mothurOut("numSeq mismatch!\n"); m->control_pressed = true; }
+ if(pNumSeqs != lNumSeqs){ m->mothurOut("numSeq mismatch!\n"); /*m->control_pressed = true;*/ }
string seqName;
double distance;
m->mothurOut(label); m->mothurOutEndLine();
- for(int i=0;i<lNumSeqs;i++){
+ for(int i=0;i<pNumSeqs;i++){
if (m->control_pressed) { return 0; }