From 58c86368f3040095a664417a20483d6c12730f71 Mon Sep 17 00:00:00 2001 From: Shifu Chen Date: Thu, 7 Dec 2017 18:06:08 +0800 Subject: [PATCH] Show base content percentage in base content graph --- src/stats.cpp | 19 +++++++++++++++++-- src/stats.h | 1 + 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/stats.cpp b/src/stats.cpp index c413d61..0d18b15 100644 --- a/src/stats.cpp +++ b/src/stats.cpp @@ -21,6 +21,7 @@ Stats::Stats(int guessedCycles, int bufferMargin){ for(int i=0; i<8; i++){ mQ20Bases[i] = 0; mQ30Bases[i] = 0; + mBaseContents[i] = 0; mCycleQ30Bases[i] = new long[mBufLen]; memset(mCycleQ30Bases[i], 0, sizeof(long) * mBufLen); @@ -135,16 +136,18 @@ void Stats::summarize(bool forced) { if(mCycleTotalBase[mBufLen-1]>0) mCycles = mBufLen; - // Q20 Q30 + // Q20, Q30, base content for(int i=0; i<8; i++) { for(int c=0; c5) + percentage = percentage.substr(0,5); + string name = base + "(" + percentage + "%)"; + json_str += "{"; json_str += "x:[" + list2string(x, total) + "],"; json_str += "y:[" + list2string(mContentCurves[base], total, x) + "],"; - json_str += "name: '" + base + "',"; + json_str += "name: '" + name + "',"; json_str += "mode:'lines',"; json_str += "line:{color:'" + colors[b] + "', width:1}\n"; json_str += "},"; diff --git a/src/stats.h b/src/stats.h index dcd975d..8dfd860 100644 --- a/src/stats.h +++ b/src/stats.h @@ -74,6 +74,7 @@ class Stats{ long mBases; long mQ20Bases[8]; long mQ30Bases[8]; + long mBaseContents[8]; long mQ20Total; long mQ30Total; bool summarized;