From: Heng Li Date: Thu, 28 May 2009 10:08:49 +0000 (+0000) Subject: * samtools-0.1.4-1 (r304) X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=94bf0806a9697592e897f65c0fe8e460451d2021;p=samtools.git * samtools-0.1.4-1 (r304) * fixed a minor bug in printing headers --- diff --git a/bamtk.c b/bamtk.c index 5dfa82a..9b3aae1 100644 --- a/bamtk.c +++ b/bamtk.c @@ -3,7 +3,7 @@ #include "bam.h" #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.1.4 (r297)" +#define PACKAGE_VERSION "0.1.4-1 (r304)" #endif int bam_taf2baf(int argc, char *argv[]); diff --git a/sam.c b/sam.c index 671b504..8411d81 100644 --- a/sam.c +++ b/sam.c @@ -67,10 +67,10 @@ samfile_t *samopen(const char *fn, const char *mode, const void *aux) sam_header_parse(alt); alt->l_text = 0; alt->text = 0; // check if there are @SQ lines in the header + fwrite(fp->header->text, 1, fp->header->l_text, fp->x.tamw); if (alt->n_targets) { // then write the header text without dumping ->target_{name,len} if (alt->n_targets != fp->header->n_targets) fprintf(stderr, "[samopen] inconsistent number of target sequences.\n"); - fwrite(fp->header->text, 1, fp->header->l_text, fp->x.tamw); } else { // then dump ->target_{name,len} for (i = 0; i < fp->header->n_targets; ++i) fprintf(fp->x.tamw, "@SQ\tSN:%s\tLN:%d\n", fp->header->target_name[i], fp->header->target_len[i]);