]> git.donarmstrong.com Git - samtools.git/commitdiff
* samtools-0.1.3-18 (r273)
authorHeng Li <lh3@live.co.uk>
Tue, 12 May 2009 13:28:39 +0000 (13:28 +0000)
committerHeng Li <lh3@live.co.uk>
Tue, 12 May 2009 13:28:39 +0000 (13:28 +0000)
 * rmdupse: do not remove unmapped reads

bam_rmdupse.c
bamtk.c

index 272fa993eba93a929330b4528a435c3eb6ef8050..df03717232b10f9e23abe8ae0e7eefbc5a6c7d02 100644 (file)
@@ -63,12 +63,13 @@ static int fill_buf(samfile_t *in, buffer_t *buf)
                for (i = 0; i < c->l_qseq; ++i) e->score += qual[i] + 1;
                e->score = (double)e->score / sqrt(c->l_qseq + 1);
                is_mapped = (c->tid < 0 || c->tid >= in->header->n_targets || (c->flag&BAM_FUNMAP))? 0 : 1;
+               if (!is_mapped) e->score = -1;
                if (is_mapped && (c->flag & BAM_FREVERSE)) {
                        e->rpos = b->core.pos + bam_calend(&b->core, bam1_cigar(b));
                        if (min_rpos > e->rpos) min_rpos = e->rpos;
                }
                if (buf->n >= capacity) {
-                       if (c->pos <= min_rpos) capacity += BLOCK_SIZE;
+                       if (is_mapped && c->pos <= min_rpos) capacity += BLOCK_SIZE;
                        else break;
                }
        }
diff --git a/bamtk.c b/bamtk.c
index 6f030a654ecbc62fe5eb5ce81c1f333b8c2682a0..2b005a5cb116c128c2f33c64ac3d8d012cbcb68c 100644 (file)
--- a/bamtk.c
+++ b/bamtk.c
@@ -3,7 +3,7 @@
 #include "bam.h"
 
 #ifndef PACKAGE_VERSION
-#define PACKAGE_VERSION "0.1.3-17 (r271)"
+#define PACKAGE_VERSION "0.1.3-18 (r273)"
 #endif
 
 int bam_taf2baf(int argc, char *argv[]);