Imported Upstream version 0.1.2
authorCharles Plessy <plessy@debian.org>
Thu, 19 Aug 2010 06:49:27 +0000 (15:49 +0900)
committerCharles Plessy <plessy@debian.org>
Thu, 19 Aug 2010 06:49:27 +0000 (15:49 +0900)
index.c
main.c
tabix.1

diff --git a/index.c b/index.c
index 80b863d3f84d53ea4c8eafb612db56150c94870a..704b037d2add76bf0c9d02624c3f449ac2bd314b 100644 (file)
--- 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 02daedf80d2b7894ecfa656314290f123e89fbc2..a2271929838803f8b53be6ba54131df9f7ae7141 100644 (file)
--- 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 4b5eea25057be28b6a7fa749ef2272a14ebfb313..aa6dc75c9f0e7a4a14e93f27b5b45bb39b8c3eb3 100644 (file)
--- 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;