<p>Dear friends,</p>

<p>I am very new to next gen sequencing. Using mplieup and bcftools in samtools I have generated a vcf file. I want to write a perl script to extract only the heterozygous snp. How can I understand which are heterozygous snps and how they can be extracted through a perl or any programming script.</p>

<p>I will be very grateful if anybody can shed some lights towards the doubt please.</p>

<p>Regards,</p>

<p>Shubhankar</p>

GT tag with 0/1 is Heterozygous. You dont need to even write a script for that.

    vcftools --gzvcf file.vcf.gz --extract-FORMAT-info GT | grep "0/1"

will work