]> git.donarmstrong.com Git - mothur.git/blobdiff - classifyotucommand.cpp
fixes while testing 1.33.0
[mothur.git] / classifyotucommand.cpp
index 217bc868eb8984c1111ff50fa84f83abeefa2059..f4a551cf59ffc95c587f47ea111081e0cfb6a727 100644 (file)
@@ -544,11 +544,11 @@ int ClassifyOtuCommand::process(ListVector* processList) {
                
                PhyloSummary* taxaSum;
         if (countfile != "") {
-            if (refTaxonomy != "") { taxaSum = new PhyloSummary(refTaxonomy, ct);  }
-            else {  taxaSum = new PhyloSummary(ct); }
+            if (refTaxonomy != "") { taxaSum = new PhyloSummary(refTaxonomy, ct,false);  }
+            else {  taxaSum = new PhyloSummary(ct,false); }
                }else {
-            if (refTaxonomy != "") { taxaSum = new PhyloSummary(refTaxonomy, groupMap);  }
-            else {  taxaSum = new PhyloSummary(groupMap); }
+            if (refTaxonomy != "") { taxaSum = new PhyloSummary(refTaxonomy, groupMap,false);  }
+            else {  taxaSum = new PhyloSummary(groupMap,false); }
         }
         
         vector<ofstream*> outSums;
@@ -574,11 +574,11 @@ int ClassifyOtuCommand::process(ListVector* processList) {
                 
                 PhyloSummary* taxaSumt;
                 if (countfile != "") {
-                    if (refTaxonomy != "") { taxaSumt = new PhyloSummary(refTaxonomy, ct);  }
-                    else {  taxaSumt = new PhyloSummary(ct); }
+                    if (refTaxonomy != "") { taxaSumt = new PhyloSummary(refTaxonomy, ct, false);  }
+                    else {  taxaSumt = new PhyloSummary(ct, false); }
                 }else {
-                    if (refTaxonomy != "") { taxaSumt = new PhyloSummary(refTaxonomy, groupMap);  }
-                    else {  taxaSumt = new PhyloSummary(groupMap); }
+                    if (refTaxonomy != "") { taxaSumt = new PhyloSummary(refTaxonomy, groupMap,false);  }
+                    else {  taxaSumt = new PhyloSummary(groupMap,false); }
                 }
                 taxaSums.push_back(taxaSumt);
             }
@@ -586,6 +586,7 @@ int ClassifyOtuCommand::process(ListVector* processList) {
         
                //for each bin in the list vector
         string snumBins = toString(processList->getNumBins());
+        vector<string> binLabels = processList->getLabels();
                for (int i = 0; i < processList->getNumBins(); i++) {
                        
                        if (m->control_pressed) { break; }
@@ -598,17 +599,8 @@ int ClassifyOtuCommand::process(ListVector* processList) {
                        names = findConsensusTaxonomy(thisNames, size, conTax);
                
                        if (m->control_pressed) { break; }
-                       
-                       //output to new names file
-            string binLabel = "Otu";
-            string sbinNumber = toString(i+1);
-            if (sbinNumber.length() < snumBins.length()) { 
-                int diff = snumBins.length() - sbinNumber.length();
-                for (int h = 0; h < diff; h++) { binLabel += "0"; }
-            }
-            binLabel += sbinNumber;
 
-                       out << binLabel << '\t' << size << '\t' << conTax << endl;
+                       out << binLabels[i] << '\t' << size << '\t' << conTax << endl;
                        
                        string noConfidenceConTax = conTax;
                        m->removeConfidences(noConfidenceConTax);
@@ -683,16 +675,8 @@ int ClassifyOtuCommand::process(ListVector* processList) {
                     
                     if (m->control_pressed) { break; }
                     
-                    //output to new names file
-                    string binLabel = "Otu";
-                    string sbinNumber = toString(i+1);
-                    if (sbinNumber.length() < snumBins.length()) { 
-                        int diff = snumBins.length() - sbinNumber.length();
-                        for (int h = 0; h < diff; h++) { binLabel += "0"; }
-                    }
-                    binLabel += sbinNumber;
                     
-                    (*outs[groupIndex[itParsed->first]]) << binLabel << '\t' << size << '\t' << conTax << endl;
+                    (*outs[groupIndex[itParsed->first]]) << binLabels[i] << '\t' << size << '\t' << conTax << endl;
                     
                     string noConfidenceConTax = conTax;
                     m->removeConfidences(noConfidenceConTax);