Permalink
Browse files

Adds hard change to mgcluster and sens.spec

  • Loading branch information...
1 parent 738f4aa commit e1d80d927ca868d595da2b3d5756c6b5fcff434d @mothur-westcott mothur-westcott committed Aug 8, 2016
@@ -20,7 +20,6 @@ vector<string> MGClusterCommand::setParameters(){
CommandParameter pcutoff("cutoff", "Number", "", "0.70", "", "", "","",false,false,true); parameters.push_back(pcutoff);
CommandParameter pprecision("precision", "Number", "", "100", "", "", "","",false,false); parameters.push_back(pprecision);
CommandParameter pmethod("method", "Multiple", "furthest-nearest-average", "average", "", "", "","",false,false); parameters.push_back(pmethod);
- CommandParameter phard("hard", "Boolean", "", "T", "", "", "","",false,false); parameters.push_back(phard);
CommandParameter pmin("min", "Boolean", "", "T", "", "", "","",false,false); parameters.push_back(pmin);
CommandParameter pmerge("merge", "Boolean", "", "T", "", "", "","",false,false); parameters.push_back(pmerge);
CommandParameter padjust("adjust", "String", "", "F", "", "", "","",false,false); parameters.push_back(padjust);
@@ -42,7 +41,7 @@ vector<string> MGClusterCommand::setParameters(){
string MGClusterCommand::getHelpString(){
try {
string helpString = "";
- helpString += "The mgcluster command parameter options are blast, name, cutoff, precision, hard, method, merge, min, length, penalty and adjust. The blast parameter is required.\n";
+ helpString += "The mgcluster command parameter options are blast, name, cutoff, precision, method, merge, min, length, penalty and adjust. The blast parameter is required.\n";
helpString += "The mgcluster command reads a blast and name file and clusters the sequences into OPF units similar to the OTUs.\n";
helpString += "This command outputs a .list, .rabund and .sabund file that can be used with mothur other commands to estimate richness.\n";
helpString += "The cutoff parameter is used to specify the maximum distance you would like to cluster to. The default is 0.70.\n";
@@ -211,9 +210,6 @@ MGClusterCommand::MGClusterCommand(string option) {
temp = validParameter.validFile(parameters, "merge", false); if (temp == "not found") { temp = "true"; }
merge = m->isTrue(temp);
- temp = validParameter.validFile(parameters, "hard", false); if (temp == "not found") { temp = "T"; }
- hard = m->isTrue(temp);
-
temp = validParameter.validFile(parameters, "adjust", false); if (temp == "not found") { if (cutoffSet) { temp = "F"; }else { temp="T"; } }
if (m->isNumeric1(temp)) { m->mothurConvert(temp, adjust); }
else if (m->isTrue(temp)) { adjust = 1.0; }
@@ -342,12 +338,8 @@ int MGClusterCommand::execute(){
}
float dist = distMatrix->getSmallDist();
- float rndDist;
- if (hard) {
- rndDist = m->ceilDist(dist, precision);
- }else{
- rndDist = m->roundDist(dist, precision);
- }
+ float rndDist = m->ceilDist(dist, precision);
+
if(previousDist <= 0.0000 && dist != previousDist){
oldList.setLabel("unique");
@@ -56,7 +56,7 @@ class MGClusterCommand : public Command {
double cutoff;
float penalty, adjust;
int precision, length, precisionLength;
- bool abort, minWanted, hclusterWanted, merge, hard, cutoffSet;
+ bool abort, minWanted, hclusterWanted, merge, cutoffSet;
void printData(ListVector*, map<string, int>&);
ListVector* mergeOPFs(map<string, int>, float);
@@ -20,7 +20,6 @@ vector<string> SensSpecCommand::setParameters(){
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 pseed("seed", "Number", "", "0", "", "", "","",false,false); parameters.push_back(pseed);
CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir);
CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir);
@@ -223,13 +222,6 @@ SensSpecCommand::SensSpecCommand(string option) {
outputDir += m->hasPath(listFile); //if user entered a file with a path then preserve it
}
- //check for optional parameter and set defaults
- // ...at some point should added some additional type checking...
- temp = validParameter.validFile(parameters, "hard", false);
- if (temp == "not found"){ hard = 1; }
- else if(!m->isTrue(temp)) { hard = 0; }
- else if(m->isTrue(temp)) { hard = 1; }
-
temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { temp = "-1.00"; }
m->mothurConvert(temp, cutoff);
@@ -310,7 +302,7 @@ int SensSpecCommand::process(map<string, int>& seqMap, ListVector*& list, bool&
if(label != "unique"){
origCutoff = label;
convert(label, cutoff);
- if(!hard){ cutoff += (0.49 / double(precision)); }
+ origCutoff = toString(m->ceilDist(cutoff, precision));
}
else{
origCutoff = "unique";
@@ -459,9 +451,8 @@ int SensSpecCommand::processListFile(){
string origCutoff = "";
bool getCutoff = 0;
- if(cutoff == -1.00) { getCutoff = 1; }
- else if( !hard ) { origCutoff = toString(cutoff); cutoff += (0.49 / double(precision)); }
- else { origCutoff = toString(cutoff); }
+ if(cutoff == -1.00) { getCutoff = 1; }
+ else { origCutoff = toString(m->ceilDist(cutoff, precision)); }
map<string, int> seqMap;
@@ -49,7 +49,6 @@ class SensSpecCommand : public Command {
long int truePositives, falsePositives, trueNegatives, falseNegatives;
bool abort, allLines, square;
- bool hard;
double cutoff;
int precision;

0 comments on commit e1d80d9

Please sign in to comment.