single sample VCF - add flag to FILTER based on AF in genotype

I am trying to either hard filter or flag variants where the AF < 0.05. The VCF was generated using MUTECT2 in GATK4.0.4.0. The VCF is a single sample VCF, and does not have 'AF' in the INFO field. It does have AF in the FORMAT field. I did try using VariantFiltration with --genotype-filter-expression "AF < 0.05" --genotype-filter-name "MAF<5%", but I have sinced learnt that this does not add a flag to the FILTER field. Any help appreciated.



  • shleeshlee CambridgeMember, Broadie, Moderator admin
    edited October 2018

    Hi @mbyvcm,

    INFO-level AF and FORMAT-level AF refer to different metrics. INFO-level AF refers to population allele frequencies while FORMAT-level AF refers to sample-level allele fraction.

    In the Mutect2 callset, if you are lacking AF in the INFO field, then this means you ran the analysis without a germline resource (--germline-resource). So you want to filter records involving somatic alleles with allele fraction <0.05. Is this correct?

    I think here you could consider co-opting the contamination filter to define the allele fraction you want to annotate/filter. What you can do is construct an artificial contamination.table, e.g.

    level   contamination   error
    whole_bam       0.05     0

    Then run FilterMutectCalls on your callset like so:

    gatk4040 FilterMutectCalls \
    -V somatic_m2.vcf.gz \
    -O filtermutectcalls.vcf.gz \
    --contamination-table contamination.table

    This should give you the result where the 7th column, the FILTER column, will have the contamination annotation.

Sign In or Register to comment.