else {
//valid paramters for this command
- string Array[] = {"cutoff","precision","method","phylip","column","name","sorted","showabund","timing","outputdir","inputdir"};
+ string Array[] = {"cutoff","hard","precision","method","phylip","column","name","sorted","showabund","timing","outputdir","inputdir"};
vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
OptionParser parser(option);
length = temp.length();
convert(temp, precision);
+ temp = validParameter.validFile(parameters, "hard", false); if (temp == "not found") { temp = "F"; }
+ hard = isTrue(temp);
+
temp = validParameter.validFile(parameters, "cutoff", false);
if (temp == "not found") { temp = "10"; }
convert(temp, cutoff);
- cutoff += (5 / (precision * 10.0));
+ cutoff += (5 / (precision * 10.0));
method = validParameter.validFile(parameters, "method", false);
if (method == "not found") { method = "furthest"; }
m->mothurOut("The name parameter allows you to enter your name file and is required if your distance file is in column format. \n");
m->mothurOut("The hcluster command should be in the following format: \n");
m->mothurOut("hcluster(column=youDistanceFile, name=yourNameFile, method=yourMethod, cutoff=yourCutoff, precision=yourPrecision) \n");
- m->mothurOut("The acceptable hcluster methods are furthest and nearest, but we hope to add average in the future.\n\n");
+ m->mothurOut("The acceptable hcluster methods are furthest, nearest and average.\n\n");
}
catch(exception& e) {
m->errorOut(e, "HClusterCommand", "help");
time_t estart = time(NULL);
if (!sorted) {
- read = new ReadCluster(distfile, cutoff, outputDir);
+ read = new ReadCluster(distfile, cutoff, outputDir, true);
read->setFormat(format);
read->read(globaldata->nameMap);
return 0;
}
-
- float rndDist = roundDist(seqs[i].dist, precision);
+
+ float rndDist;
+ if (hard) {
+ rndDist = ceilDist(seqs[i].dist, precision);
+ }else{
+ rndDist = roundDist(seqs[i].dist, precision);
+ }
+
if((previousDist <= 0.0000) && (seqs[i].dist != previousDist)){
printData("unique");