]> git.donarmstrong.com Git - mothur.git/blobdiff - matrixoutputcommand.cpp
added get.rabund and get.sabund command and fixed bug introduced by line by line...
[mothur.git] / matrixoutputcommand.cpp
index 3ecf6df36e5ea33266d409fecee2620aec7a2d9f..6602bf93ae462ab54c9f97433222bd8fab17babc 100644 (file)
@@ -94,13 +94,14 @@ int MatrixOutputCommand::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;
                                
                if (lookup.size() < 2) { cout << "You have not provided enough valid groups.  I cannot run the command." << endl; return 0;}
                
                numGroups = globaldata->Groups.size();
                                
                //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){                   
                                cout << lookup[0]->getLabel() << '\t' << count << endl;
@@ -108,6 +109,7 @@ int MatrixOutputCommand::execute(){
                                
                                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)) {