Skip to content

Commit 6a4b9f9

Browse files
committed
r974: more informative msg on wrong FASTQ records
Resolves #510
1 parent a7a01fe commit 6a4b9f9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

bseq.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ mm_bseq1_t *mm_bseq_read3(mm_bseq_file_t *fp, int64_t chunk_size, int with_qual,
9999
size += s->l_seq;
100100
if (size >= chunk_size) {
101101
if (frag_mode && a.a[a.n-1].l_seq < CHECK_PAIR_THRES) {
102-
while (kseq_read(ks) >= 0) {
102+
while ((ret = kseq_read(ks)) >= 0) {
103103
kseq2bseq(ks, &fp->s, with_qual, with_comment);
104104
if (mm_qname_same(fp->s.name, a.a[a.n-1].name)) {
105105
kv_push(mm_bseq1_t, 0, a, fp->s);
@@ -110,8 +110,10 @@ mm_bseq1_t *mm_bseq_read3(mm_bseq_file_t *fp, int64_t chunk_size, int with_qual,
110110
break;
111111
}
112112
}
113-
if (ret < -1)
114-
fprintf(stderr, "[WARNING]\033[1;31m wrong FASTA/FASTQ record. Continue anyway.\033[0m\n");
113+
if (ret < -1) {
114+
if (a.n) fprintf(stderr, "[WARNING]\033[1;31m failed to parse the FASTA/FASTQ record next to '%s'. Continue anyway.\033[0m\n", a.a[a.n-1].name);
115+
else fprintf(stderr, "[WARNING]\033[1;31m failed to parse the first FASTA/FASTQ record. Continue anyway.\033[0m\n");
116+
}
115117
*n_ = a.n;
116118
return a.a;
117119
}

main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "mmpriv.h"
88
#include "ketopt.h"
99

10-
#define MM_VERSION "2.17-r973-dirty"
10+
#define MM_VERSION "2.17-r974-dirty"
1111

1212
#ifdef __linux__
1313
#include <sys/resource.h>

0 commit comments

Comments
 (0)