How to create a new VCF file with subsetted data
2
0
Entering edit mode
2.4 years ago

Hello! So, lets say I have a sorted, indexed (tabix) VCF file, and wanted to make a new subsetted VCF file out of the that contains only a specific region from chr1. In that case, I know that tabix chr1.vcf.gz:<start>-<end> will give you the raw subsetted genotype data. How do I create a valid VCF file out of this? Thanks!

vcf tabix subset • 1.1k views
ADD COMMENT
4
Entering edit mode
2.4 years ago
tabix --print-header in.vcf.gz "chr1:234-567"

should output a valid VCF.

but bcftools remains the tool of choice.

vcftools is deprecated.

ADD COMMENT
1
Entering edit mode
2.4 years ago
chefer ▴ 350

Would the Site Filtering Options in the vcftools manual work?

ADD COMMENT
0
Entering edit mode

Actually I just used bcftools view and subset the specified chromosome. I'd imagine subsetting via vcftools would be equivalently good.

ADD REPLY
0
Entering edit mode

Please accept their answer to mark the post as solved.

ADD REPLY

Login before adding your answer.

Traffic: 1659 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