]> git.donarmstrong.com Git - samtools.git/commitdiff
* samtools-0.1.5-2 (r391)
authorHeng Li <lh3@live.co.uk>
Sun, 12 Jul 2009 17:42:43 +0000 (17:42 +0000)
committerHeng Li <lh3@live.co.uk>
Sun, 12 Jul 2009 17:42:43 +0000 (17:42 +0000)
 * do not show a blank screen when no reads mapped

bam_tview.c
bamtk.c

index be2579ca0ee28f59792e863bd102b2f7937566d0..39793ad686e34376333972cd47af090b87c07da1 100644 (file)
@@ -50,11 +50,11 @@ int tv_pl_func(uint32_t tid, uint32_t pos, int n, const bam_pileup1_t *pl, void
        // print referece
        rb = (tv->ref && pos - tv->left_pos < tv->l_ref)? tv->ref[pos - tv->left_pos] : 'N';
        for (i = tv->last_pos + 1; i < pos; ++i) {
-               if (i%10 == 0) mvprintw(0, tv->ccol, "%-d", i+1);
+               if (i%10 == 0 && tv->mcol - tv->ccol >= 10) mvprintw(0, tv->ccol, "%-d", i+1);
                c = tv->ref? tv->ref[i - tv->left_pos] : 'N';
                mvaddch(1, tv->ccol++, c);
        }
-       if (pos%10 == 0) mvprintw(0, tv->ccol, "%-d", pos+1);
+       if (pos%10 == 0 && tv->mcol - tv->ccol >= 10) mvprintw(0, tv->ccol, "%-d", pos+1);
        // print consensus
        call = bam_maqcns_call(n, pl, tv->bmc);
        attr = A_UNDERLINE;
@@ -240,6 +240,13 @@ int tv_draw_aln(tview_t *tv, int tid, int pos)
        bam_lplbuf_reset(tv->lplbuf);
        bam_fetch(tv->fp, tv->idx, tv->curr_tid, tv->left_pos, tv->left_pos + tv->mcol, tv, tv_fetch_func);
        bam_lplbuf_push(0, tv->lplbuf);
+
+       while (tv->ccol < tv->mcol) {
+               int pos = tv->last_pos + 1;
+               if (pos%10 == 0 && tv->mcol - tv->ccol >= 10) mvprintw(0, tv->ccol, "%-d", pos+1);
+               mvaddch(1, tv->ccol++, (tv->ref && pos < tv->l_ref)? tv->ref[pos - tv->left_pos] : 'N');
+               ++tv->last_pos;
+       }
        return 0;
 }
 
diff --git a/bamtk.c b/bamtk.c
index f253852e04d846a94bafc35407df5819cf013457..6b4db510a97a3d6e0c7b14a460227690d4a1ab83 100644 (file)
--- a/bamtk.c
+++ b/bamtk.c
@@ -4,7 +4,7 @@
 #include "bam.h"
 
 #ifndef PACKAGE_VERSION
-#define PACKAGE_VERSION "0.1.5-1 (r390)"
+#define PACKAGE_VERSION "0.1.5-2 (r391)"
 #endif
 
 int bam_taf2baf(int argc, char *argv[]);