how do i grep the vcf, so that i only need the GT information
Input:
chr1 67947 rs1202587463 A AT . PASS - GT:GQ:DP:AD:MIN_DP:PGT:PID:PL:SB 0/0:22:21:.:11:.:.:.:. 0/0:24:21:.:9:.:.:.:. 0/0:2
chr1 69928 . T TAC . PASS - GT:GQ:DP:AD:MIN_DP:PGT:PID:PL:SB 0/0:21:22:.:8:.:.:.:. 0/0:35:34:.:21:.:.:.:. 0/0:30:18:.:1
I want the output as
chr1 67947 rs1202587463 A AT . PASS - GT 0/0 0/0 0/0
chr1 69928 . T TAC . PASS - GT 0/0 0/0
I tried using sed -e 's/:.:.:.:.:.:.:.:.//g' ani.vcf but everything after GT gets eliminated
chr1 67947 rs1202587463 A AT . PASS - GT
chr1 69928 . T TAC . PASS - GT
usually I don't grep VCF if avoidable by using bcftools
bcftools query my.vcf -f '[\t%GT]\n