]> git.donarmstrong.com Git - mothur.git/blobdiff - rarefactsharedcommand.cpp
added get.rabund and get.sabund command and fixed bug introduced by line by line...
[mothur.git] / rarefactsharedcommand.cpp
index efcbe8437c0ba18902d493ef3a2c7abfe420c960..c9300259f90726511200a077c9ef633ec7eaa76b 100644 (file)
@@ -83,9 +83,10 @@ int RareFactSharedCommand::execute(){
                //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
                set<string> processedLabels;
                set<string> userLabels = globaldata->labels;
+               set<int> userLines = globaldata->lines;
        
                //as long as you are not at the end of the file or done wih the lines you want
-               while((lookup[0] != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
+               while((lookup[0] != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                        
                        if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(lookup[0]->getLabel()) == 1){
                                
@@ -96,6 +97,7 @@ int RareFactSharedCommand::execute(){
                                cout << lookup[0]->getLabel() << '\t' << count << endl;
                                processedLabels.insert(lookup[0]->getLabel());
                                userLabels.erase(lookup[0]->getLabel());
+                               userLines.erase(count);
                        }
                        
                        if ((anyLabelsToProcess(lookup[0]->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLookup[0]->getLabel()) != 1)) {