Permalink
Browse files

Fixes bug with taxlevels in summary files

  • Loading branch information...
1 parent dbc624b commit 33010638aa3242484a442e042be2b2604d62179b @mothur-westcott mothur-westcott committed Feb 2, 2017
Showing with 10 additions and 6 deletions.
  1. +1 −1 source/classifier/phylosummary.cpp
  2. +9 −5 source/commands/classifyotucommand.cpp
@@ -233,7 +233,7 @@ int PhyloSummary::addSeqToTree(string seqName, string seqTaxonomy){
int index = tree.size() - 1;
tree[index].parent = currentNode;
- tree[index].level = (level+1);
+ tree[index].level = level;
tree[currentNode].children[taxon] = index;
int thisCount = 1;
@@ -325,8 +325,9 @@ int ClassifyOtuCommand::execute(){
while((list != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
if (allLines == 1 || labels.count(list->getLabel()) == 1){
-
- m->mothurOut(list->getLabel() + "\t" + toString(list->size())); m->mothurOutEndLine();
+ string output = toString(list->size()); if (basis == "sequence") { output = toString(list->getNumSeqs()); }
+
+ m->mothurOut(list->getLabel() + "\t" + toString(output)); m->mothurOutEndLine();
process(list);
if (m->control_pressed) { outputTypes.clear(); for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } if (ct != NULL) { delete ct; } if (groupMap != NULL) { delete groupMap; } delete input; delete list; return 0; }
@@ -339,7 +340,9 @@ int ClassifyOtuCommand::execute(){
delete list;
list = input->getListVector(lastLabel);
- m->mothurOut(list->getLabel() + "\t" + toString(list->size())); m->mothurOutEndLine();
+
+ string output = toString(list->size()); if (basis == "sequence") { output = toString(list->getNumSeqs()); }
+ m->mothurOut(list->getLabel() + "\t" + toString(output)); m->mothurOutEndLine();
process(list);
@@ -374,7 +377,8 @@ int ClassifyOtuCommand::execute(){
if (needToRun == true) {
if (list != NULL) { delete list; }
list = input->getListVector(lastLabel);
- m->mothurOut(list->getLabel() + "\t" + toString(list->size())); m->mothurOutEndLine();
+ string output = toString(list->size()); if (basis == "sequence") { output = toString(list->getNumSeqs()); }
+ m->mothurOut(list->getLabel() + "\t" + toString(output)); m->mothurOutEndLine();
process(list);
delete list;
@@ -733,7 +737,7 @@ int ClassifyOtuCommand::process(ListVector* processList) {
}
delete taxaSum;
-
+
return 0;
}

0 comments on commit 3301063

Please sign in to comment.