From 4e75514bade8a0bfb37f09f3e4373579be71b57a Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Thu, 29 Aug 2019 18:26:09 +0200 Subject: [PATCH] obi import: fixed entry count --- python/obitools3/utils.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/obitools3/utils.pyx b/python/obitools3/utils.pyx index 45fafdb..28ef89a 100755 --- a/python/obitools3/utils.pyx +++ b/python/obitools3/utils.pyx @@ -72,6 +72,8 @@ cpdef int count_entries(file, bytes format): return -1 mmapped_file = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) total_count += len(re.findall(sep, mmapped_file)) + if format != b"ngsfilter" and format != b"tabular": + total_count += 1 # adding +1 for 1st entry because separators include \n (ngsfilter and tabular already count one more because of last \n) except: if len(files) > 1: