CommandParameter pshared("shared", "InputTypes", "", "", "none", "none", "none",false,true); parameters.push_back(pshared);
CommandParameter plabel("label", "String", "", "", "", "", "",false,false); parameters.push_back(plabel);
CommandParameter pfreq("freq", "Number", "", "100", "", "", "",false,false); parameters.push_back(pfreq);
- CommandParameter pcalc("calc", "Multiple", "sharedchao-sharedsobs-sharedace-jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan-kstest-whittaker-sharednseqs-ochiai-anderberg-skulczynski-kulczynskicody-lennon-morisitahorn-braycurtis-odum-canberra-structeuclidean-structchord-hellinger-manhattan-structpearson-soergel-spearman-structkulczynski-speciesprofile-structchi2-hamming-gower-memchi2-memchord-memeuclidean-mempearson", "sharedsobs-sharedchao-sharedace-jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan", "", "", "",true,false); parameters.push_back(pcalc);
+ CommandParameter pcalc("calc", "Multiple", "sharedchao-sharedsobs-sharedace-jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan-kstest-whittaker-sharednseqs-ochiai-anderberg-kulczynski-kulczynskicody-lennon-morisitahorn-braycurtis-odum-canberra-structeuclidean-structchord-hellinger-manhattan-structpearson-soergel-spearman-structkulczynski-speciesprofile-structchi2-hamming-gower-memchi2-memchord-memeuclidean-mempearson", "sharedsobs-sharedchao-sharedace-jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan", "", "", "",true,false); parameters.push_back(pcalc);
CommandParameter pall("all", "Boolean", "", "F", "", "", "",false,false); parameters.push_back(pall);
CommandParameter pgroups("groups", "String", "", "", "", "", "",false,false); parameters.push_back(pgroups);
CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir);
outputTypes["sharednseqs"] = tempOutNames;
outputTypes["ochiai"] = tempOutNames;
outputTypes["anderberg"] = tempOutNames;
- outputTypes["skulczynski"] = tempOutNames;
+ outputTypes["kulczynski"] = tempOutNames;
outputTypes["kulczynskicody"] = tempOutNames;
outputTypes["lennon"] = tempOutNames;
outputTypes["morisitahorn"] = tempOutNames;
//allow user to run help
if(option == "help") { help(); abort = true; calledHelp = true; }
+ else if(option == "citation") { citation(); abort = true; calledHelp = true;}
else {
vector<string> myArray = setParameters();
outputTypes["sharednseqs"] = tempOutNames;
outputTypes["ochiai"] = tempOutNames;
outputTypes["anderberg"] = tempOutNames;
- outputTypes["skulczynski"] = tempOutNames;
+ outputTypes["kulczynski"] = tempOutNames;
outputTypes["kulczynskicody"] = tempOutNames;
outputTypes["lennon"] = tempOutNames;
outputTypes["morisitahorn"] = tempOutNames;
sharedfile = m->getSharedFile();
if (sharedfile != "") { m->mothurOut("Using " + sharedfile + " as input file for the shared parameter."); m->mothurOutEndLine(); }
else { m->mothurOut("You have no current sharedfile and the shared parameter is required."); m->mothurOutEndLine(); abort = true; }
- }
+ }else { m->setSharedFile(sharedfile); }
//if the user changes the output directory command factory will send this info to us in the output parameter
if (calc == "default") { calc = "sharedsobs-sharedchao-sharedace-jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan"; }
}
m->splitAtDash(calc, Estimators);
+ if (m->inUsersGroups("citation", Estimators)) {
+ ValidCalculators validCalc; validCalc.printCitations(Estimators);
+ //remove citation from list of calcs
+ for (int i = 0; i < Estimators.size(); i++) { if (Estimators[i] == "citation") { Estimators.erase(Estimators.begin()+i); break; } }
+ }
groups = validParameter.validFile(parameters, "groups", false);
if (groups == "not found") { groups = ""; }
else {
m->splitAtDash(groups, Groups);
}
- m->Groups = Groups;
+ m->setGroups(Groups);
string temp;
temp = validParameter.validFile(parameters, "freq", false); if (temp == "not found") { temp = "100"; }
- convert(temp, freq);
+ m->mothurConvert(temp, freq);
temp = validParameter.validFile(parameters, "all", false); if (temp == "not found") { temp = "false"; }
all = m->isTrue(temp);
}else if (Estimators[i] == "anderberg") {
cDisplays.push_back(new CollectDisplay(new Anderberg(), new SharedOneColumnFile(fileNameRoot+"anderberg")));
outputNames.push_back(fileNameRoot+"anderberg"); outputTypes["anderberg"].push_back(fileNameRoot+"anderberg");
- }else if (Estimators[i] == "skulczynski") {
+ }else if (Estimators[i] == "kulczynski") {
cDisplays.push_back(new CollectDisplay(new Kulczynski(), new SharedOneColumnFile(fileNameRoot+"kulczynski")));
outputNames.push_back(fileNameRoot+"kulczynski"); outputTypes["kulczynski"].push_back(fileNameRoot+"kulczynski");
}else if (Estimators[i] == "kulczynskicody") {
//set users groups
SharedUtil* util = new SharedUtil();
- util->setGroups(m->Groups, m->namesOfGroups, "collect");
+ Groups = m->getGroups();
+ vector<string> allGroups = m->getAllGroups();
+ util->setGroups(Groups, allGroups, "collect");
+ m->setGroups(Groups);
+ m->setAllGroups(allGroups);
delete util;
while((order != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
if (m->control_pressed) {
- for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear();
+ for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } outputTypes.clear();
for(int i=0;i<cDisplays.size();i++){ delete cDisplays[i]; }
delete order; delete input;
- m->Groups.clear();
+ m->clearGroups();
return 0;
}
}
if (m->control_pressed) {
- for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear();
+ for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } outputTypes.clear();
for(int i=0;i<cDisplays.size();i++){ delete cDisplays[i]; }
- m->Groups.clear();
+ m->clearGroups();
delete input;
return 0;
}
delete cCurve;
if (m->control_pressed) {
- for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear();
+ for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } outputTypes.clear();
for(int i=0;i<cDisplays.size();i++){ delete cDisplays[i]; }
delete order;
delete input;
- m->Groups.clear();
+ m->clearGroups();
return 0;
}
for(int i=0;i<cDisplays.size();i++){ delete cDisplays[i]; }
//reset groups parameter
- m->Groups.clear();
+ m->clearGroups();
delete input;
m->mothurOutEndLine();