]> git.donarmstrong.com Git - mothur.git/blobdiff - sensspeccommand.cpp
modifications to commands to add headers to list file.
[mothur.git] / sensspeccommand.cpp
index 12786ca41c848d967ffda72e2d06f382881d8eed..5746cdabc2161d094dcde6ab24b864d69db9ee8e 100644 (file)
@@ -793,6 +793,8 @@ string SensSpecCommand::preProcessList(){
                        //make a new list vector
                        ListVector newList;
                        newList.setLabel(list.getLabel());
+            vector<string> binLabels = list.getLabels();
+            vector<string> newLabels;
                        
                        //for each bin
                        for (int i = 0; i < list.getNumBins(); i++) {
@@ -812,13 +814,16 @@ string SensSpecCommand::preProcessList(){
                                //if there are names in this bin add to new list
                                if (newNames != "") { 
                                        newNames = newNames.substr(0, newNames.length()-1); //rip off extra comma
-                                       newList.push_back(newNames);    
+                                       newList.push_back(newNames);
+                    newLabels.push_back(binLabels[i]);
                                }
                        }
             
                        //print new listvector
                        if (newList.getNumBins() != 0) {
                                wroteSomething = true;
+                newList.setLabels(newLabels);
+                if (!m->printedListHeaders) { newList.printHeaders(out); }
                                newList.print(out);
                        }