X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=hclustercommand.cpp;h=3e99473bb6d742cd759c6a5a3eed55373df58549;hb=e150b0b0664caec517485ee6d69dcdade6dcae77;hp=503bc48273069f829103788ce2711bc12d56ea42;hpb=1d898dc6edaf9e9f287fab53bf1f21fb29757a17;p=mothur.git diff --git a/hclustercommand.cpp b/hclustercommand.cpp index 503bc48..3e99473 100644 --- a/hclustercommand.cpp +++ b/hclustercommand.cpp @@ -17,8 +17,8 @@ vector HClusterCommand::setParameters(){ CommandParameter pcolumn("column", "InputTypes", "", "", "PhylipColumn", "PhylipColumn", "ColumnName",false,false); parameters.push_back(pcolumn); CommandParameter pcutoff("cutoff", "Number", "", "10", "", "", "",false,false); parameters.push_back(pcutoff); CommandParameter pprecision("precision", "Number", "", "100", "", "", "",false,false); parameters.push_back(pprecision); - CommandParameter pmethod("method", "Multiple", "furthest-nearest-average-weighted", "furthest", "", "", "",false,false); parameters.push_back(pmethod); - CommandParameter phard("hard", "Boolean", "", "F", "", "", "",false,false); parameters.push_back(phard); + CommandParameter pmethod("method", "Multiple", "furthest-nearest-average-weighted", "average", "", "", "",false,false); parameters.push_back(pmethod); + CommandParameter phard("hard", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(phard); CommandParameter psorted("sorted", "Boolean", "", "F", "", "", "",false,false); parameters.push_back(psorted); CommandParameter pshowabund("showabund", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(pshowabund); CommandParameter ptiming("timing", "Boolean", "", "F", "", "", "",false,false); parameters.push_back(ptiming); @@ -74,11 +74,10 @@ HClusterCommand::HClusterCommand(string option) { //allow user to run help if(option == "help") { help(); abort = true; calledHelp = true; } + else if(option == "citation") { citation(); abort = true; calledHelp = true;} else { - //valid paramters for this command - string Array[] = {"cutoff","hard","precision","method","phylip","column","name","sorted","showabund","timing","outputdir","inputdir"}; - vector myArray (Array, Array+(sizeof(Array)/sizeof(string))); + vector myArray = setParameters(); OptionParser parser(option); map parameters = parser.getParameters(); @@ -184,7 +183,7 @@ HClusterCommand::HClusterCommand(string option) { length = temp.length(); convert(temp, precision); - temp = validParameter.validFile(parameters, "hard", false); if (temp == "not found") { temp = "F"; } + temp = validParameter.validFile(parameters, "hard", false); if (temp == "not found") { temp = "T"; } hard = m->isTrue(temp); temp = validParameter.validFile(parameters, "cutoff", false); @@ -193,7 +192,7 @@ HClusterCommand::HClusterCommand(string option) { cutoff += (5 / (precision * 10.0)); method = validParameter.validFile(parameters, "method", false); - if (method == "not found") { method = "furthest"; } + if (method == "not found") { method = "average"; } if ((method == "furthest") || (method == "nearest") || (method == "average") || (method == "weighted")) { } else { m->mothurOut("Not a valid clustering method. Valid clustering algorithms are furthest, nearest, average or weighted."); m->mothurOutEndLine(); abort = true; }