Using tabix to subset a region from a VCF file
0
1
Entering edit mode
3.0 years ago

I've read quite a few posts that suggest I can subset my VCF file for a region of interest using Tabix.

However, when I try as below the output file is empty

VCF="/Volumes/Seagate Expansion Drive/temp/130iPSC_061118.snp.vcf.gz"
tabix -p vcf "$VCF"
tabix "$VCF" 15:31196055-31235311 > "$DIR"/vcf/sliced.vcf
tabix "$VCF" -R "$DIR"/source/regions.bed > "$DIR"/vcf/tabix.vcf

I've subsequently managed to get it working using vcftools, as follows:

vcftools --gzvcf "$VCF" --chr chr15 --from-bp 31196055 --to-bp 31235311 --recode --recode-INFO-all --out "$DIR"/vcf/sliced

But I'd still like to know how to use Tabix

tabix conda vcf • 2.4k views
ADD COMMENT
1
Entering edit mode

you are also selecting a region 0 bases long with 1:17375-17375. you may also need to use chr1 instead of 1

ADD REPLY
0
Entering edit mode

chr15 worked for me, thanks!

ADD REPLY
0
Entering edit mode

You have disagreement between the chromosome identifiers in your examples: 15:31196055-31235311 in the example that doesn't work vs chr15 in the example that does work. Tabix works to select regions just like in your example, if the region identifiers are correctly specified.

ADD REPLY

Login before adding your answer.

Traffic: 2026 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6