Skip to content

Commit 7b8d656

Browse files
committed
fixes #17
1 parent cf76c28 commit 7b8d656

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

grabix.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ int create_grabix_index(string bgzf_file)
104104
{
105105
// grab the next line and store the offset
106106
eof = bgzf_getline(bgzf_fp, '\n', line);
107-
offset = bgzf_tell (bgzf_fp);
107+
offset = bgzf_tell(bgzf_fp);
108108
chunk_count++;
109109
// stop if we have encountered an empty line
110-
if (eof <= 0)
110+
if (eof <= 0 || offset == prev_offset)
111111
{
112112
if (bgzf_check_EOF(bgzf_fp) == 1) {
113113
if (offset > prev_offset) {

grabix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ using namespace std;
77
#include "bgzf.h"
88

99

10-
#define VERSION "0.1.7"
10+
#define VERSION "0.1.8"
1111
// we only want to store the offset for every 10000th
1212
// line. otherwise, were we to store the position of every
1313
// line in the file, the index could become very large for

test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ echo "indexing"
99
time ./grabix index $FQ
1010
echo "indexed"
1111
python tests/test-fastq.py $FQ
12-
a=$(grabix grab test.cnt.gz $(($lines * 4)))
12+
a=$(./grabix grab test.cnt.gz $(($lines * 4)))
1313
b=$(zless $FQ | tail -1)
1414
if [[ "$a" != "$b" ]]; then
1515
echo FAIL last record

0 commit comments

Comments
 (0)