Question: How To Run Tabix Locally
2
gravatar for Peixe
6.4 years ago by
Peixe580
Spain
Peixe580 wrote:

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?

vcf local tabix • 4.4k views
ADD COMMENTlink modified 6.4 years ago by Istvan Albert ♦♦ 81k • written 6.4 years ago by Peixe580
2
gravatar for Pierre Lindenbaum
6.4 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum122k wrote:

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
ADD COMMENTlink modified 6.4 years ago • written 6.4 years ago by Pierre Lindenbaum122k
1

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.

ADD REPLYlink written 6.4 years ago by Giovanni M Dall'Olio26k

Hmmm... This is weird. Before I was skipping the first step. But now, once done, I only get an empty file (just the header)...

ADD REPLYlink written 6.4 years ago by Peixe580
1

chr22 has a big telomeric region in 5': you won't find any variant here: Try another region.

ADD REPLYlink written 6.4 years ago by Pierre Lindenbaum122k
1

hahaha... I feel silly now. Years in this world, now I know it...

ADD REPLYlink written 6.4 years ago by Peixe580
1

Make sure your chromosomes named as "22" not "chr22", or you need to use "chr22:150000-160000".

ADD REPLYlink written 6.4 years ago by lh331k

Yep, it works now. Thank you all!

ADD REPLYlink written 6.4 years ago by Peixe580
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1651 users visited in the last hour