X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=normalizesharedcommand.cpp;fp=normalizesharedcommand.cpp;h=07c353af3c33847978638fd71d1e220d34c090d4;hb=dbcb14c17c128987e59147f510950f32dbeb6698;hp=718eeb131397ecbe99702a1a38b20d3e8e7bc04d;hpb=75962c819c16814e5c2340d99af1aa62e564dc20;p=mothur.git diff --git a/normalizesharedcommand.cpp b/normalizesharedcommand.cpp index 718eeb1..07c353a 100644 --- a/normalizesharedcommand.cpp +++ b/normalizesharedcommand.cpp @@ -240,6 +240,7 @@ int NormalizeSharedCommand::execute(){ m->mothurOut("Normalizing to " + toString(norm) + "."); m->mothurOutEndLine(); } + //as long as you are not at the end of the file or done wih the lines you want while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0))) { @@ -248,6 +249,7 @@ int NormalizeSharedCommand::execute(){ if(allLines == 1 || labels.count(lookup[0]->getLabel()) == 1){ m->mothurOut(lookup[0]->getLabel()); m->mothurOutEndLine(); + if (!m->printedHeaders) { lookup[0]->printHeaders(out); } normalize(lookup, out); processedLabels.insert(lookup[0]->getLabel()); @@ -260,7 +262,7 @@ int NormalizeSharedCommand::execute(){ for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; } lookup = input->getSharedRAbundVectors(lastLabel); m->mothurOut(lookup[0]->getLabel()); m->mothurOutEndLine(); - + if (!m->printedHeaders) { lookup[0]->printHeaders(out); } normalize(lookup, out); processedLabels.insert(lookup[0]->getLabel()); @@ -301,7 +303,7 @@ int NormalizeSharedCommand::execute(){ lookup = input->getSharedRAbundVectors(lastLabel); m->mothurOut(lookup[0]->getLabel()); m->mothurOutEndLine(); - + if (!m->printedHeaders) { lookup[0]->printHeaders(out); } normalize(lookup, out); for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; } @@ -351,6 +353,8 @@ int NormalizeSharedCommand::execute(){ if(allLines == 1 || labels.count(lookupFloat[0]->getLabel()) == 1){ m->mothurOut(lookupFloat[0]->getLabel()); m->mothurOutEndLine(); + + if (!m->printedHeaders) { lookupFloat[0]->printHeaders(out); } normalize(lookupFloat, out); processedLabels.insert(lookupFloat[0]->getLabel()); @@ -362,8 +366,9 @@ int NormalizeSharedCommand::execute(){ for (int i = 0; i < lookupFloat.size(); i++) { delete lookupFloat[i]; } lookupFloat = input->getSharedRAbundFloatVectors(lastLabel); - m->mothurOut(lookupFloat[0]->getLabel()); m->mothurOutEndLine(); + m->mothurOut(lookupFloat[0]->getLabel()); m->mothurOutEndLine(); + if (!m->printedHeaders) { lookupFloat[0]->printHeaders(out); } normalize(lookupFloat, out); processedLabels.insert(lookupFloat[0]->getLabel()); @@ -405,6 +410,7 @@ int NormalizeSharedCommand::execute(){ m->mothurOut(lookupFloat[0]->getLabel()); m->mothurOutEndLine(); + if (!m->printedHeaders) { lookupFloat[0]->printHeaders(out); } normalize(lookupFloat, out); for (int i = 0; i < lookupFloat.size(); i++) { delete lookupFloat[i]; }