Permalink
Browse files

Adjusts cutoff for agc and dgc methods

cluster and cluster.split

#254
  • Loading branch information...
1 parent 5ddcbf3 commit fc821b8c4a333be95e9ccd5a48fc14f4de077ea3 @mothur-westcott mothur-westcott committed Jul 20, 2016
Showing with 13 additions and 12 deletions.
  1. +8 −7 source/commands/clustercommand.cpp
  2. +5 −5 source/commands/clustersplitcommand.cpp
@@ -257,13 +257,6 @@ ClusterCommand::ClusterCommand(string option) {
temp = validParameter.validFile(parameters, "sim", false); if (temp == "not found") { temp = "F"; }
sim = m->isTrue(temp);
- //bool cutoffSet = false;
- temp = validParameter.validFile(parameters, "cutoff", false);
- if (temp == "not found") { temp = "10"; }
- //else { cutoffSet = true; }
- m->mothurConvert(temp, cutoff);
- cutoff += (5 / (precision * 10.0));
-
//temp = validParameter.validFile(parameters, "adjust", false); if (temp == "not found") { temp = "F"; }
//if (m->isNumeric1(temp)) { m->mothurConvert(temp, adjust); }
//else if (m->isTrue(temp)) { adjust = 1.0; }
@@ -283,6 +276,14 @@ ClusterCommand::ClusterCommand(string option) {
#else
if ((method == "agc") || (method == "dgc")) { m->mothurOut("[ERROR]: The agc and dgc clustering methods are not available for Windows, aborting\n."); abort = true; }
#endif
+
+ //bool cutoffSet = false;
+ temp = validParameter.validFile(parameters, "cutoff", false);
+ if (temp == "not found") { temp = "10"; }
+ //else { cutoffSet = true; }
+ m->mothurConvert(temp, cutoff);
+ if ((method != "agc") && (method != "dgc")) { cutoff += (5 / (precision * 10.0)); }
+
showabund = validParameter.validFile(parameters, "showabund", false);
if (showabund == "not found") { showabund = "T"; }
@@ -346,11 +346,6 @@ ClusterSplitCommand::ClusterSplitCommand(string option) {
//not using file option and don't have fasta method with classic
if (((splitmethod != "fasta") && classic) && (file == "")) { m->mothurOut("[ERROR]: splitmethod must be fasta to use cluster.classic, or you must use the file option.\n"); abort=true; }
-
- cutoffNotSet = false;
- temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { cutoffNotSet = true; temp = "0.25"; }
- m->mothurConvert(temp, cutoff);
- cutoff += (5 / (precision * 10.0));
temp = validParameter.validFile(parameters, "taxlevel", false); if (temp == "not found") { temp = "3"; }
m->mothurConvert(temp, taxLevelCutoff);
@@ -369,6 +364,11 @@ ClusterSplitCommand::ClusterSplitCommand(string option) {
if ((method == "agc") || (method == "dgc")) { m->mothurOut("[ERROR]: The agc and dgc clustering methods are not available for Windows, aborting\n."); abort = true; }
#endif
+ cutoffNotSet = false;
+ temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { cutoffNotSet = true; temp = "0.25"; }
+ m->mothurConvert(temp, cutoff);
+ if ((method != "agc") && (method != "dgc")) { cutoff += (5 / (precision * 10.0)); }
+
if ((splitmethod == "distance") || (splitmethod == "classify") || (splitmethod == "fasta")) { }
else { m->mothurOut("[ERROR]: " + splitmethod + " is not a valid splitting method. Valid splitting algorithms are distance, classify or fasta."); m->mothurOutEndLine(); abort = true; }

0 comments on commit fc821b8

Please sign in to comment.