This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to annotate your vcf files with the GT (genotype) field

Hi there

So I am generating a .vcf file with samtools mpileup which is piped through bcftools view and bcftools norm. In the output I kindly get the fields DP and AD amongst others for which I asked for in the mpileup options. What I am not getting is the GT field and neither the documentation nor the help output give me a hint on how to get it.

So first, is samtools able to create the GT field? If not, how are all the GT fields in the world of .vcf files created ? ;)

Thanks so much for any help

EDIT:

I am doing this for three .bam files together. The exact command would be:

mpileup -u -A -B -d 100000 -t DP -t AD -t ADF -t ADR -f GRCh37.fa \ 
     --positions exac_variant_sites.snp.bed \
     patient1_tumorsample1.bam patient1_tumorsample2.bam patient1_germline.bam | \ 
     bcftools view | \ 
     bcftools norm -m-any -f GRCh37.fa - > gtless.vcf
samtools mpileup vcf genotype sequencing

Are you running the commands with BAM files from several samples or genotypes? Could you explain further or make an example of your commands?

Hi - I have edited my post and put the exact command ;)

Not sure if this paragraph could sed light:

"The VCF file produced by BCFtools does not strictly conform the VCF spec. For example, the GT genotype information is not always present because for the purpose of BCF, GT is unnecessary and takes disk space. In addition, GT is not the first as is required by the VCF spec. This can be fixed by the bcf-fix.pl script that comes with the source code package, and will be fixed in future (fixed in r880+)."

http://samtools.sourceforge.net/mpileup.shtml

Thanks! In any case - given that samtools does not do it (fixed in r880+ says it should) - do you know any other way of annotating the .vcf file with the GT field..?

bcf-fix.pl does not fix it? have you tried it?

do you have the same mpileup result using -v?

"Compute genotype likelihoods and output them in the variant call format (VCF). Output is bgzip-compressed VCF unless -u option is set."

1 answer

Hi Michi,

Did you figure out how to identify GT and AF fields with samtools? I tried the above suggestions but it doesn't work..

Thank you for your help.

Log in to answer this question.