Skip to content
Permalink
Browse files

Merge pull request #203 from fbreitwieser/master

Fix taxonomy report - Make format compatible with Pavian
  • Loading branch information...
martin-steinegger committed May 14, 2019
2 parents 3c793dd + 59e1991 commit 5fcc48fbf4f6697e73e1e2a4b3f53c6cdf87e8f1
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/taxonomy/taxonomyreport.cpp
@@ -46,19 +46,19 @@ void taxReport(FILE* FP,
unsigned int taxCount = it == cladeCounts.end()? 0 : it->second.taxCount;
if (taxID == 0) {
if (cladeCount > 0) {
fprintf(FP, "%.4f\t%i\t%i\t%i\tno rank\tunidentified\n",
fprintf(FP, "%.4f\t%i\t%i\tno rank\t0\tunclassified\n",
100 * cladeCount / double(totalReads),
cladeCount, taxCount, taxID);
cladeCount, taxCount);
}
taxReport(FP, taxDB, cladeCounts, totalReads, 1);
} else {
if (cladeCount == 0) {
return;
}
const TaxonNode* taxon = taxDB.taxonNode(taxID);
fprintf(FP, "%.4f\t%i\t%i\t%i\t%s\t%s%s\n",
100*cladeCount/double(totalReads), cladeCount, taxCount, taxID,
taxon->rank.c_str(), std::string(2*depth, ' ').c_str(), taxon->name.c_str());
fprintf(FP, "%.4f\t%i\t%i\t%s\t%i\t%s%s\n",
100*cladeCount/double(totalReads), cladeCount, taxCount,
taxon->rank.c_str(), taxID, std::string(2*depth, ' ').c_str(), taxon->name.c_str());

std::vector<TaxID> children = it->second.children;
std::sort(children.begin(), children.end(), [&](int a, int b) { return cladeCountVal(cladeCounts, a) > cladeCountVal(cladeCounts,b); });

0 comments on commit 5fcc48f

Please sign in to comment.
You can’t perform that action at this time.