This is a test version of Biostars. For the public version, visit https://www.biostars.org.
get variant chromosome, start, and end position from vcf

Hi all,

I am need to understand how to extract the chromosome, start position, and end position for each variant in a vcf file. I have the vcf, and bam files really I need the position of the variant.

I thought maybe vcf tools would help, but my results don't make sense. Any help would be greatly appreciated. Thanks very much.

vcf

1 answer

bcftools query -f '%CHROM:%POS-%END\n' in.vcf

Do we have any pythonic way of getting start and end positions of a variant from VCF file?

Log in to answer this question.