From: Heng Li Date: Wed, 15 Apr 2009 12:00:08 +0000 (+0000) Subject: * samtools-0.1.2-26 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5fb80400b8e7ed3d7f782ad13897d6fcac2e03f1;p=samtools.git * samtools-0.1.2-26 * fixed a bug in rmdup when there are unmapped reads --- diff --git a/bam_rmdup.c b/bam_rmdup.c index 321938f..5026901 100644 --- a/bam_rmdup.c +++ b/bam_rmdup.c @@ -76,6 +76,11 @@ void bam_rmdup_core(bamFile in, bamFile out) fprintf(stderr, "[bam_rmdup_core] %llu unmatched pairs\n", (long long)kh_size(del_set)); clear_del_set(del_set); } + if ((int)c->tid == -1) { // append unmapped reads + bam_write1(out, b); + while (bam_read1(in, b) >= 0) bam_write1(out, b); + break; + } last_tid = c->tid; fprintf(stderr, "[bam_rmdup_core] processing reference %s...\n", header->target_name[c->tid]); } diff --git a/bamtk.c b/bamtk.c index 096cb90..e0bccb7 100644 --- a/bamtk.c +++ b/bamtk.c @@ -3,7 +3,7 @@ #include "bam.h" #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.1.2-25" +#define PACKAGE_VERSION "0.1.2-26" #endif int bam_taf2baf(int argc, char *argv[]);