Skip to content

Commit

Permalink
r667: warn if one query file has fewer records #92
Browse files Browse the repository at this point in the history
  • Loading branch information
lh3 committed Jan 28, 2018
1 parent 72b9b0e commit 43bfa61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions bseq.c
Expand Up @@ -115,10 +115,15 @@ mm_bseq1_t *mm_bseq_read_frag(int n_fp, mm_bseq_file_t **fp, int chunk_size, int
*n_ = 0;
if (n_fp < 1) return 0;
while (1) {
int n_read = 0;
for (i = 0; i < n_fp; ++i)
if (kseq_read(fp[i]->ks) < 0)
break;
if (i != n_fp) break; // some file reaches the end
if (kseq_read(fp[i]->ks) >= 0)
++n_read;
if (n_read < n_fp) {
if (n_read > 0)
fprintf(stderr, "[W::%s]\033[1;31m query files have different number of records; extra records skipped.\033[0m\n", __func__);
break; // some file reaches the end
}
if (a.m == 0) kv_resize(mm_bseq1_t, 0, a, 256);
for (i = 0; i < n_fp; ++i) {
mm_bseq1_t *s;
Expand Down
2 changes: 1 addition & 1 deletion main.c
Expand Up @@ -6,7 +6,7 @@
#include "mmpriv.h"
#include "getopt.h"

#define MM_VERSION "2.7-r666-dirty"
#define MM_VERSION "2.7-r667-dirty"

#ifdef __linux__
#include <sys/resource.h>
Expand Down

0 comments on commit 43bfa61

Please sign in to comment.