From b31f4daa13f0feef40b850a959014328d69bce87 Mon Sep 17 00:00:00 2001
From: Julien Guglielmini <julien.guglielmini@pasteur.fr>
Date: Thu, 17 Feb 2022 17:52:13 +0100
Subject: [PATCH] Fix final check

---
 wGRR | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/wGRR b/wGRR
index bdcdaf7..73a2ce7 100755
--- a/wGRR
+++ b/wGRR
@@ -348,8 +348,8 @@ if [[ ! -f "$OUT".wgrr.txt ]] ; then
 fi
 
 NLINES=$(wc -l "$OUT".wgrr.txt | awk '{print $1}')
-NWGRR=$((STATS[1]*2+1))
-if [[ $NLINES -le $NWGRR ]] ; then
+NWGRR=$((STATS[1]*STATS[1]+1))
+if [[ $NLINES -lt $NWGRR ]] ; then
 	echo "[ERROR]     --  An error occurred during wGRR calculation:"
 	echo "[ERROR]     --  less lines than expected in the final file."
 	echo "[ERROR]     --  Saving the partial files in ${OUT}.wgrr_part directory."
-- 
GitLab