From 0a3bf89715283e4d322d28ba4147e987e3477ee3 Mon Sep 17 00:00:00 2001 From: Charles Plessy Date: Thu, 19 Aug 2010 15:49:27 +0900 Subject: [PATCH] Imported Upstream version 0.1.2 --- index.c | 8 ++++---- main.c | 2 +- tabix.1 | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/index.c b/index.c index 80b863d..704b037 100644 --- a/index.c +++ b/index.c @@ -158,7 +158,7 @@ static int get_intv(ti_index_t *idx, kstring_t *str, ti_intv_t *intv) intv->tid = get_tid(idx, str->s + b); if (i != str->l) str->s[i] = '\t'; } else if (id == idx->conf.bc) { - // here ->beg is 1-based. it will be changed to 0-based at the end of this routine. + // here ->beg is 0-based. intv->beg = intv->end = strtol(str->s + b, &s, 0); if (!(idx->conf.preset&TI_FLAG_UCSC)) --intv->beg; } else { @@ -174,7 +174,7 @@ static int get_intv(ti_index_t *idx, kstring_t *str, ti_intv_t *intv) if (op == 'M' || op == 'D' || op == 'N') l += x; s = t + 1; } - intv->end = intv->beg + l - 1; + intv->end = intv->beg + l; } } else if ((idx->conf.preset&0xffff) == TI_PRESET_VCF) { // FIXME: the following is NOT tested and is likely to be buggy @@ -188,7 +188,7 @@ static int get_intv(ti_index_t *idx, kstring_t *str, ti_intv_t *intv) s = t + 1; } else ++s; } - intv->end = intv->beg + max - 1; + intv->end = intv->beg + max; } } } @@ -197,7 +197,7 @@ static int get_intv(ti_index_t *idx, kstring_t *str, ti_intv_t *intv) } } if (intv->tid < 0 || intv->beg < 0 || intv->end < 0) return -1; - intv->bin = ti_reg2bin(intv->beg-1, intv->end); + intv->bin = ti_reg2bin(intv->beg, intv->end); return 0; } diff --git a/main.c b/main.c index 02daedf..a227192 100644 --- a/main.c +++ b/main.c @@ -5,7 +5,7 @@ #include "bgzf.h" #include "tabix.h" -#define PACKAGE_VERSION "0.1.1 (r542)" +#define PACKAGE_VERSION "0.1.2 (r543)" static int fetch_func(int l, const char *s, void *data) { diff --git a/tabix.1 b/tabix.1 index 4b5eea2..aa6dc75 100644 --- a/tabix.1 +++ b/tabix.1 @@ -69,8 +69,8 @@ are all stored in the index file and thus not used in data retrieval. [1] Column of start chromosomal position. [4] .TP .BI "-e " INT -Column of end chromosomal position. The end column can be the same as -start column, [5] +Column of end chromosomal position. The end column can be the same as the +start column. [5] .TP .BI "-S " INT Skip first INT lines in the data file. [0] @@ -84,7 +84,7 @@ rather than 1-based. .RE .SH EXAMPLE -grep -v ^"#" unsorted.gff | sort -k1,1 -k4,4n | bgzip -c > sorted.gff.gz; +(grep ^"#" in.gff; grep -v ^"#" in.gff | sort -k1,1 -k4,4n) | bgzip > sorted.gff.gz; tabix -p gff sorted.gff.gz; -- 2.30.2