From 06548fdf3d2dfa5532500b9c9f52f91b01ed87ad Mon Sep 17 00:00:00 2001 From: Shifu Chen Date: Tue, 26 Jun 2018 18:19:56 +0800 Subject: [PATCH] report mean read length --- src/htmlreporter.cpp | 12 +++++++++++- src/jsonreporter.cpp | 6 ++++++ src/stats.cpp | 11 +++++++++++ src/stats.h | 2 ++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/htmlreporter.cpp b/src/htmlreporter.cpp index 23d1773..f84771d 100644 --- a/src/htmlreporter.cpp +++ b/src/htmlreporter.cpp @@ -113,6 +113,16 @@ void HtmlReporter::printSummary(ofstream& ofs, FilterResult* result, Stats* preS ofs << "\n"; outputRow(ofs, "fastp version:", string(FASTP_VER)+ " (https://github.com/OpenGene/fastp)"); outputRow(ofs, "sequencing:", sequencingInfo); + + // report read length change + if(mOptions->isPaired()) { + outputRow(ofs, "mean length before filtering:", to_string(preStats1->getMeanLength()) + "bp, " + to_string(preStats2->getMeanLength()) + "bp"); + outputRow(ofs, "mean length after filtering:", to_string(postStats1->getMeanLength()) + "bp, " + to_string(postStats2->getMeanLength()) + "bp"); + } else { + outputRow(ofs, "mean length before filtering:", to_string(preStats1->getMeanLength()) + "bp"); + outputRow(ofs, "mean length after filtering:", to_string(postStats1->getMeanLength()) + "bp"); + } + if(mOptions->duplicate.enabled) { string dupStr = to_string(mDupRate*100) + "%"; if(!mOptions->isPaired()) @@ -367,7 +377,7 @@ void HtmlReporter::printCSS(ofstream& ofs){ ofs << "