From 1ef8ee37fa796dd58e4c18681939a2fafe84ee0c Mon Sep 17 00:00:00 2001 From: Petr Danecek Date: Tue, 24 Apr 2012 09:51:47 +0100 Subject: [PATCH] init_regions: check for non-matching sequence names --- misc/bamcheck.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/misc/bamcheck.c b/misc/bamcheck.c index e5bfb5d..c7db8ab 100644 --- a/misc/bamcheck.c +++ b/misc/bamcheck.c @@ -15,7 +15,7 @@ */ -#define BAMCHECK_VERSION "2012-04-23" +#define BAMCHECK_VERSION "2012-04-24" #define _ISOC99_SOURCE #include @@ -1082,7 +1082,7 @@ void init_regions(stats_t *stats, char *file) if ( iter == kh_end(header_hash) ) { if ( !warned ) - fprintf(stderr,"Warning: Some sequences not present in the BAM (%s)\n", line); + fprintf(stderr,"Warning: Some sequences not present in the BAM, e.g. \"%s\". This message is printed only once.\n", line); warned = 1; continue; } @@ -1116,6 +1116,7 @@ void init_regions(stats_t *stats, char *file) stats->regions[tid].npos++; } if (line) free(line); + if ( !stats->regions ) error("Unable to map the -t sequences to the BAM sequences.\n"); fclose(fp); } -- 2.39.2