Skip to content

Instantly share code, notes, and snippets.

@knmkr
Last active December 16, 2015 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knmkr/5405249 to your computer and use it in GitHub Desktop.
Save knmkr/5405249 to your computer and use it in GitHub Desktop.
How to use `tabix`.

#How to use tabix

tabixはvcfやbed形式などのタブ区切りファイルにインデックスを張るソフトウェア.インデックスファイルの拡張子は.tbi. 1000 Genomes Projectのftpでは,vcfファイルに対して*.vcf.gz.tbiが用意されているので,tabixを使って閲覧すると何かと便利なはず.

##Install

$ wget http://sourceforge.net/projects/samtools/files/tabix/tabix-0.2.6.tar.bz2
$ bzip2 -dc tabix-0.2.6.tar.bz2 | tar xvf -
$ cd tabix-0.2.6/
$ make
$ ./tabix

Program: tabix (TAB-delimited file InderXer)
Version: 0.2.5 (r1005)
…
$ # add /path/to/tabix to your PATH

##Example

あるvcfファイルのうち,指定したgenomic positionの領域を出力する例. -hはvcfのヘッダも出力するためのオプション. 例のように,ftp越しで使える.

$ tabix -h ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/release/20110521/ALL.chr6.phase1_release_v3.20101123.snps_indels_svs.genotypes.vcf.gz 6:31830969-31846823

[get_local_version] downloading the index file...
##fileformat=VCFv4.1
##INFO=<ID=LDAF,Number=1,Type=Float,Description="MLE Allele Frequency Accounting for LD">
##INFO=<ID=AVGPOST,Number=1,Type=Float,Description="Average posterior probability from MaCH/Thunder">
##INFO=<ID=RSQ,Number=1,Type=Float,Description="Genotype imputation quality from MaCH/Thunder">
##INFO=<ID=ERATE,Number=1,Type=Float,Description="Per-marker Mutation rate from MaCH/Thunder">
##INFO=<ID=THETA,Number=1,Type=Float,Description="Per-marker Transition rate from MaCH/Thunder">
##INFO=<ID=CIEND,Number=2,Type=Integer,Description="Confidence interval around END for imprecise variants">
##INFO=<ID=CIPOS,Number=2,Type=Integer,Description="Confidence interval around POS for imprecise variants">
##INFO=<ID=END,Number=1,Type=Integer,Description="End position of the variant described in this record">
##INFO=<ID=HOMLEN,Number=.,Type=Integer,Description="Length of base pair identical micro-homology at event breakpoints">
…

##Reference

The 1000 Genomes Command lineTutorial Exercises.

(ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/technical/working/20120229_tutorial_docs/G1K_commandline_based_tutorial_answers_20120217.pdf)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment