]> git.donarmstrong.com Git - mothur.git/blobdiff - clusterdoturcommand.cpp
fixed bug with trim.seqs- when a file is blank for a grouping mothur removed it,...
[mothur.git] / clusterdoturcommand.cpp
index 1c0c78d274359b7156506f6697e0aa039754a38d..56fbd5c0d6c2b8e9380959bd6ba97435b28fcd70 100644 (file)
@@ -13,7 +13,7 @@
 //**********************************************************************************************************************
 vector<string> ClusterDoturCommand::getValidParameters(){      
        try {
-               string AlignArray[] =  {"phylip","cutoff","precision","method","outputdir","inputdir"};
+               string AlignArray[] =  {"phylip","name","hard","cutoff","precision","method","outputdir","inputdir"};
                vector<string> myArray (AlignArray, AlignArray+(sizeof(AlignArray)/sizeof(string)));
                return myArray;
        }
@@ -72,7 +72,7 @@ ClusterDoturCommand::ClusterDoturCommand(string option)  {
                
                else {
                        //valid paramters for this command
-                       string Array[] =  {"phylip","cutoff","precision","method","outputdir","inputdir"};
+                       string Array[] =  {"phylip","name","cutoff","hard","precision","method","outputdir","inputdir"};
                        vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
                        
                        OptionParser parser(option);
@@ -223,12 +223,11 @@ int ClusterDoturCommand::execute(){
                oldRAbund = *rabund;
                oldList = *list;
 
-               double saveCutoff = cutoff;
+               //double saveCutoff = cutoff;
                
                int estart = time(NULL);
        
-               while (cluster->getSmallDist() < cutoff && cluster->getNSeqs() > 0){
-               
+               while ((cluster->getSmallDist() < cutoff) && (cluster->getNSeqs() > 1)){
                        if (m->control_pressed) { delete cluster; delete list; delete rabund; sabundFile.close();rabundFile.close();listFile.close();  for (int i = 0; i < outputNames.size(); i++) {   remove(outputNames[i].c_str());         } outputTypes.clear();  return 0;  }
                
                        cluster->update(cutoff);
@@ -267,11 +266,11 @@ int ClusterDoturCommand::execute(){
                
                delete cluster; delete nameMap; delete list; delete rabund;
        
-               if (saveCutoff != cutoff) { 
-                       if (hard)       {  saveCutoff = m->ceilDist(saveCutoff, precision);     }
-                       else            {       saveCutoff = m->roundDist(saveCutoff, precision);  }
-                       m->mothurOut("changed cutoff to " + toString(cutoff)); m->mothurOutEndLine(); 
-               }
+               //if (saveCutoff != cutoff) { 
+               //      if (hard)       {  saveCutoff = m->ceilDist(saveCutoff, precision);     }
+               //      else            {       saveCutoff = m->roundDist(saveCutoff, precision);  }
+               //      m->mothurOut("changed cutoff to " + toString(cutoff)); m->mothurOutEndLine(); 
+               //}
                
                m->mothurOutEndLine();
                m->mothurOut("Output File Names: "); m->mothurOutEndLine();