my_vcf.vcf:
##fileformat=VCFv4.1
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT SMAPLE
chr22 50482719 chr22:50482719:AACACTCGGGCCCCCGAAG:A AACACTCGGGCCCCCGAAG A . PASS AF=7e-05 GT 0|0
chr22 50482725 chr22:50482725:CGGGCCCCCGAAGACA:C CGGGCCCCCGAAGACA C . PASS AF=7e-05 GT 0|0
chr22 50482740 chr22:50482740:A:C A C . PASS AF=7e-05 GT 0|0
bcftools view -r chr22:50482735-50487454 my_vcf.vcf
returns all these rows, not just the last one. Is this a bug or am I missing something obvious. I seem to be using the -r
switch correctly: -r, --regions chr|chr:pos|chr:beg-end|chr:beg-[,…]
The only other thing that I can think of is maybe bcftools does something internally to adjust the position of indels, if that is the case it really hurts my workflow :(
bcftools view -r chr22:50482735-50487454 -t chr22:50482735-50487454 my_vcf.vcf
Looks like I can use them both to avoid this issue and still benefit from tab indexing.
just noticed in docs: