This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bcftools view gives empty file when trying to subset it

I need to subset a vcf file, so I ran the following commands:

bgzip BATCH1.vcf
bcftools index BATCH1.vcf.gz
bcftools view BATCH1.vcf.gz -r 1:3494620,1:3826786 -o batch1_subset.vcf

And got an empty batch1_subset.vcf. I know well that there is 3494620 position at chr1, and there is 3826786, I verified that, but see no output generated. Why?

bcftools

1 answer

try with '1:3494620-3494620,1:3826786-3826786' or 'chr1:3494620-3494620,chr1:3826786-3826786' ?

Ok, this is the answer. Could you explain why it is like that? I would expect specifying only one region if I need only one region. I will accept the answer if you post.

Log in to answer this question.