]> git.donarmstrong.com Git - samtools.git/commitdiff
* samtools-0.1.3-15 (r266)
authorHeng Li <lh3@live.co.uk>
Tue, 5 May 2009 21:23:27 +0000 (21:23 +0000)
committerHeng Li <lh3@live.co.uk>
Tue, 5 May 2009 21:23:27 +0000 (21:23 +0000)
 * report an error if a non-* reference is present while @SQ is absent

bam_import.c
bamtk.c

index fe9af911f890bdb6a70f56e6206ea6f8923f718b..77e324319525b529ac456aad2e9d9f84769e7b2d 100644 (file)
@@ -241,8 +241,12 @@ int sam_read1(tamFile fp, bam_header_t *header, bam1_t *b)
        { // flag, tid, pos, qual
                ret = ks_getuntil(ks, KS_SEP_TAB, str, &dret); z += str->l + 1; c->flag = atoi(str->s);
                ret = ks_getuntil(ks, KS_SEP_TAB, str, &dret); z += str->l + 1; c->tid = bam_get_tid(header, str->s);
-               if (c->tid < 0 && strcmp(str->s, "*"))
-                       fprintf(stderr, "[sam_read1] reference '%s' is recognized as '*'.\n", str->s);
+               if (c->tid < 0 && strcmp(str->s, "*")) {
+                       if (header->n_targets == 0) {
+                               fprintf(stderr, "[sam_read1] missing header? Abort!\n");
+                               exit(1);
+                       } else fprintf(stderr, "[sam_read1] reference '%s' is recognized as '*'.\n", str->s);
+               }
                ret = ks_getuntil(ks, KS_SEP_TAB, str, &dret); z += str->l + 1; c->pos = isdigit(str->s[0])? atoi(str->s) - 1 : -1;
                ret = ks_getuntil(ks, KS_SEP_TAB, str, &dret); z += str->l + 1; c->qual = isdigit(str->s[0])? atoi(str->s) : 0;
                if (ret < 0) return -2;
diff --git a/bamtk.c b/bamtk.c
index 316b1285c0fb367a35f770cd39644ecfe8662a36..31ef17ce48343d9275aadecaca5d5268d8195ea1 100644 (file)
--- a/bamtk.c
+++ b/bamtk.c
@@ -3,7 +3,7 @@
 #include "bam.h"
 
 #ifndef PACKAGE_VERSION
-#define PACKAGE_VERSION "0.1.3-14 (r262)"
+#define PACKAGE_VERSION "0.1.3-15 (r266)"
 #endif
 
 int bam_taf2baf(int argc, char *argv[]);