Imported Upstream version 0.1.1
[tabix.git] / tabix.1
1 .TH tabix 1 "16 March 2009" "tabix-0.1.1" "Bioinformatics tools"
2 .SH NAME
3 .PP
4 bgzip - Block compression/decompression utility
5 .PP
6 tabix - Generic indexer for TAB-delimited genome position files
7 .SH SYNOPSIS
8 .PP
9 .B bgzip
10 .RB [ \-cdh ]
11 .RB [ \-b
12 .IR virtualOffset ]
13 .RB [ \-s
14 .IR size ]
15 .RI [ file ]
16 .PP
17 .B tabix
18 .RB [ \-0 ]
19 .RB [ \-p
20 .R gff|bed|sam|vcf]
21 .RB [ \-s
22 .IR seqCol ]
23 .RB [ \-b
24 .IR begCol ]
25 .RB [ \-e
26 .IR endCol ]
27 .RB [ \-S
28 .IR lineSkip ]
29 .RB [ \-c
30 .IR metaChar ]
31 .I in.tab.bgz
32 .RI [ "region1 " [ "region2 " [ ... "]]]"
33
34 .SH DESCRIPTION
35 .PP
36 Tabix indexes a TAB-delimited genome position file
37 .I in.tab.bgz
38 and creates an index file
39 .I in.tab.bgz.tbi
40 when
41 .I region
42 is absent from the command-line. The input data file must be position
43 sorted and compressed by
44 .B bgzip
45 which has a
46 .BR gzip (1)
47 like interface. After indexing, tabix is able to quickly retrieve data
48 lines overlapping
49 .I regions
50 specified in the format "chr:beginPos-endPos". Fast data retrieval also
51 works over network if URI is given as a file name and in this case the
52 index file will be downloaded if it is not present locally.
53
54 .SH OPTIONS OF TABIX
55 .TP 10
56 .BI "-p " STR
57 Input format for indexing. Valid values are: gff, bed, sam, vcf and
58 psltab. This option should not be applied together with any of
59 .BR \-s ", " \-b ", " \-e ", " \-c " and " \-0 ;
60 it is not used for data retrieval because this setting is stored in
61 the index file. [gff]
62 .TP
63 .BI "-s " INT
64 Column of sequence name. Option
65 .BR \-s ", " \-b ", " \-e ", " \-S ", " \-c " and " \-0
66 are all stored in the index file and thus not used in data retrieval. [1]
67 .TP
68 .BI "-b " INT
69 Column of start chromosomal position. [4]
70 .TP
71 .BI "-e " INT
72 Column of end chromosomal position. The end column can be the same as
73 start column, [5]
74 .TP
75 .BI "-S " INT
76 Skip first INT lines in the data file. [0]
77 .TP
78 .BI "-c " CHAR
79 Skip lines started with character CHAR. [#]
80 .TP
81 .B -0
82 Specify that the position in the data file is 0-based (e.g. UCSC files)
83 rather than 1-based.
84 .RE
85
86 .SH EXAMPLE
87 grep -v ^"#" unsorted.gff | sort -k1,1 -k4,4n | bgzip -c > sorted.gff.gz;
88
89 tabix -p gff sorted.gff.gz;
90
91 tabix sorted.gff.gz chr1:10,000,000-20,000,000;
92
93 .SH NOTES
94 It is straightforward to achieve overlap queries using the standard
95 B-tree index (with or without binning) implemented in all SQL databases,
96 or the R-tree index in PostgreSQL and Oracle. But there are still many
97 reasons to use tabix. Firstly, tabix directly works with a lot of widely
98 used TAB-delimited formats such as GFF/GTF and BED. We do not need to
99 design database schema or specialized binary formats. Data do not need
100 to be duplicated in different formats, either. Secondly, tabix works on
101 compressed data files while most SQL databases do not. The GenCode
102 annotation GTF can be compressed down to 4%.  Thirdly, tabix is
103 fast. The same indexing algorithm is known to work efficiently for an
104 alignment with a few billion short reads. SQL databases probably cannot
105 easily handle data at this scale. Last but not the least, tabix supports
106 remote data retrieval. One can put the data file and the index at an FTP
107 or HTTP server, and other users or even web services will be able to get
108 a slice without downloading the entire file.
109
110 .SH AUTHOR
111 .PP
112 Tabix was written by Heng Li. The BGZF library was originally
113 implemented by Bob Handsaker and modified by Heng Li for remote file
114 access and in-memory caching.
115
116 .SH SEE ALSO
117 .PP
118 .BR samtools (1)