From 34d7191ecf32d5f8cc43d08d53654d1ab3da1981 Mon Sep 17 00:00:00 2001
From: Blaise Li <blaise.li__git@nsup.org>
Date: Thu, 15 Feb 2018 16:53:05 +0100
Subject: [PATCH] More robust size factor parsing.

There was a bug occurring when a library name was contained in another.
---
 bam2bigwig.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bam2bigwig.sh b/bam2bigwig.sh
index c26e64f..2534b05 100755
--- a/bam2bigwig.sh
+++ b/bam2bigwig.sh
@@ -82,7 +82,7 @@ then
     if [ -f ${norm} ]
     then
         echo "reading scaling factor for ${lib_name} in ${norm}"
-        size=$(grep "${lib_name}" ${norm} | cut -f2)
+        size=$(grep -w "^${lib_name}" ${norm} | cut -f2)
         if [ ! ${size} ]
         then
             error_exit "size could not be found on column 2, line ${lib_name} of ${norm}"
-- 
GitLab