I have a vcf file like below

chr1    10109   .   AACCCT  A   21.51   PASS    AC=2;AF=1.000;AN=2;DP=10;FS=8.451;MQ=13.01;MQRankSum=0.000;QD=2.15;ReadPosRankSum=-1.300;SOR=3.236;FractionInformativeReads=0.700;R2_5P_bias=0.000  GT:AD:AF:DP:F1R2:F2R1:GQ:PL:GP:PRI:SB:MB    ./.:3,4:0.571:7:1,1:2,3:6:30,8,0:2.1511e+01,5.8560e+00,1.3473e+00:0.00,7.00,10.01:1,2,4,0:3,0,1,3
chr1    10230   .   AC  A   29.28   PASS    AC=1;AF=0.500;AN=2;DP=21;FS=12.601;MQ=20.22;MQRankSum=-0.715;QD=1.39;ReadPosRankSum=1.109;SOR=4.407;FractionInformativeReads=0.667;R2_5P_bias=-3.357    GT:AD:AF:DP:F1R2:F2R1:GQ:PL:GP:PRI:SB:MB    0/1:6,8:0.571:14:1,4:5,4:22:59,0,19:2.9283e+01,2.9815e-02,2.2470e+01:0.00,30.00,33.01:3,3,0,8:2,4,4,4

I am going to subset this VCF by the coordinates given in a bed file using tabix

This is how my bed file looks

chr7    127471196  127472363
chr7    127472363  127473530
chr7    127473530  127474697
chr7    127474697  127475864

This is my command

tabix -h filevcf.gz -R XXX.bed > file.vcf.gz_extracted.vcf.gz

But output file is empty after headers I can not find variants in the output

I look at output by bcftools view -H file.vcf.gz_extracted.vcf.gz > output.txt which is totally empty

Where I am making a mistake here?

I got results when I used some of positions in input vcf

  • 1
    $\begingroup$ Do you have a typo in the name of the file? it should be file.vcf.gz (it's missing a period). $\endgroup$ Feb 5 at 2:46
  • 1
    $\begingroup$ Also: is the file block-gzipped and indexed? (you can check that it's block gzipped by running "file" on it....if the results is "Blocked GNU Zip Format (BGZF; gzip compatible)" ) $\endgroup$ Feb 5 at 2:46
  • $\begingroup$ Could you clarify what you mean by: "got results when I used some of positions in input vcf"? used how? $\endgroup$ Feb 5 at 2:49
  • 1
    $\begingroup$ From what you show us here, we see a vcf that lacks headers and a bed that describes positions not present in the vcf. So empty results are expected. Please show us an example that you expect to produce output and then we can actually test. $\endgroup$
    – terdon
    Feb 13 at 11:36


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.