Note: the file must be compressed using the bgzip tool provided in the tabix package. If the file is compressed with another tool (e.g. tar), tabix won't work correctly.
I have a local vcf file on my computer (it is actually the full chromosome 22). I would like to subset it in regions. I know tabix can do it, but I can't find the way...
When I use tabix to connect to the ftp server there is no problem; I easily get the vcf file. But doing it locally, even if I download and put in the same folder the proper index .tbi file, I get nothing.
This is the command I am using:
/home/peixe/tabix-0.2.6/tabix -fh -p vcf ALL.chr22.phase1_release_v3.20101123.snps_indels_svs.genotypes.vcf.gz 22:1500000-1600000
But I am only getting an empty vcf file. In the tabix help manual, it does not not provide any tip about it...
Does anyone know a way to do it?
1 answer
to use tabix, you need TWO steps:
first create an index (*.tbi) with the BGZIPpped VCF:
/home/peixe/tabix-0.2.6/tabix -f -p vcf ALL.chr22.phase1_release_v3.20101123.snps_indels_svs.genotypes.vcf.gz
the index is created, you can now query :
/home/peixe/tabix-0.2.6/tabix -h ALL.chr22.phase1_release_v3.20101123.snps_indels_svs.genotypes.vcf.gz 22:1500000-1600000
Hmmm... This is weird. Before I was skipping the first step. But now, once done, I only get an empty file (just the header)...
Log in to answer this question.