]> git.donarmstrong.com Git - samtools.git/commitdiff
* samtools-0.1.2-26
authorHeng Li <lh3@live.co.uk>
Wed, 15 Apr 2009 12:00:08 +0000 (12:00 +0000)
committerHeng Li <lh3@live.co.uk>
Wed, 15 Apr 2009 12:00:08 +0000 (12:00 +0000)
 * fixed a bug in rmdup when there are unmapped reads

bam_rmdup.c
bamtk.c

index 321938f3215506dbf54ebc76666c40165d2024a6..50269010d7e6760ddfa8f908df3b7349ab4d83cd 100644 (file)
@@ -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 096cb90003997fe30f4620a4202ef1c54b3110f2..e0bccb75a4a09ec0f2f7b5740c675555cf4c323d 100644 (file)
--- 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[]);