]> git.donarmstrong.com Git - mothur.git/blobdiff - removeotuscommand.cpp
added calcs to tree.shared. working on remove.rare command
[mothur.git] / removeotuscommand.cpp
index 6828c7287f3530aa009ec9d42e12c8eaacbb724c..1a7d3bd8eb5c1a876e6edc6282418dd2d1ce3b30 100644 (file)
@@ -367,11 +367,17 @@ int RemoveOtusCommand::processList(ListVector*& list, GroupMap*& groupMap, ofstr
                                if (m->inUsersGroups(group, Groups)) {  removeBin = true; }
                                groupFileOutput += individual + "\t" + group + "\n";                            
                                
-                               //if there are no sequences from the groups we want to remove in this bin add to new list, output to groupfile
-                               newList.push_back(binnames);    
-                               outGroup << groupFileOutput;
+                               if (!removeBin) {
+                                       //if there are no sequences from the groups we want to remove in this bin add to new list, output to groupfile
+                                       newList.push_back(binnames);    
+                                       outGroup << groupFileOutput;
+                               }else {
+                                       numOtus++;
+                               }
+                       }else {
                                numOtus++;
                        }
+                       
                }
                
                //print new listvector
@@ -382,6 +388,7 @@ int RemoveOtusCommand::processList(ListVector*& list, GroupMap*& groupMap, ofstr
                
                m->mothurOut(newList.getLabel() + " - removed " + toString(numOtus) + " of the " + toString(list->getNumBins()) + " OTUs."); m->mothurOutEndLine();
                
+               return 0;
                
        }
        catch(exception& e) {