From 0135d929301d24c464d843573e4ea56cd0f3e139 Mon Sep 17 00:00:00 2001 From: Johnathan Wong <34543031+jowong4@users.noreply.github.com> Date: Wed, 21 Apr 2021 17:47:28 -0700 Subject: [PATCH] ntcard.cpp: update low kmer sample check to evaluate entire expression --- ntcard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntcard.cpp b/ntcard.cpp index 68351ee..80e3cc9 100644 --- a/ntcard.cpp +++ b/ntcard.cpp @@ -259,7 +259,7 @@ compEst(const uint16_t* t_Counter, double& F0Mean, double fMean[]) (opt::rBits * log(2) - log(pMean[0])) * 1.0 * ((size_t)1 << (opt::sBits + opt::rBits))); for (size_t i = 0; i < 65536; i++) fMean[i] = 0; - if (pMean[0] == 0) { + if (pMean[0] * (log(pMean[0]) - opt::rBits * log(2)) == 0) { return; } fMean[1] = -1.0 * pMean[1] / (pMean[0] * (log(pMean[0]) - opt::rBits * log(2)));