VCF filtering with Allele Balance (AB) using FilterVcf (Picard)
3
2
Entering edit mode
17 days ago
Eduardo ▴ 20

Hello,

I am trying to use FilterVcf (Picard) to filter out variant with AB<0.2 and AB>0.75 on my GATK vcf file. I saw that on FilterVcf documentation only have --MIN_AB parameter. Therefore, I cannot exclude variants with AB>0.75. Is there another software that can do this or do an annotation of AB on GATK vcf (because now there no AB annotation in GATK vcf)?

Allele-Balance FilterVcf Picard GATK • 585 views
ADD COMMENT
3
Entering edit mode
17 days ago

You can do that kind of operation with one-liners, they can be powerful when dealing with VCF files. See the example here) for MAF filtering on a homozygous species, you will need to adapt it for your own needs.

ADD COMMENT
1
Entering edit mode
4 days ago
GokalpC ▴ 170

FilterVcf also has a scripting feature to filter variants.

Here is one that I have made for filtering CNV calls. You can modify the inner functions as you see fit. function accept() is mandatory.

function accept(vc) {

var qs = vc.getGenotype(0).getAnyAttribute("QS");
var cn = vc.getGenotype(0).getAnyAttribute("CN");
var np = vc.getGenotype(0).getAnyAttribute("NP");

switch (cn) {
    case 0:
        return qs >= Math.min(1000, Math.max(400, 10*np));
    case 1:
        return qs >= Math.min(1000, Math.max(100, 10*np));
    default:
        return qs >= Math.min(400, Math.max(50, 4*np));
    } 
} 
accept(variant);

Just add this to a file named yourfilter.js and give it as a parameter.

ADD COMMENT
0
Entering edit mode
7 days ago
Eduardo ▴ 20

I think I got using bcftools.

Here is my command:

bcftools filter -i 'FMT/GT = "het" & FMT/DP>=20 & sum(FMT/AD[*:1]/FMT/DP)>.2 & sum(FMT/AD[*:1]/FMT/DP)<=.75 | GT="hom" & FMT/DP>=20' input.vcf.gz -Oz9 --threads 36 -o output.vcf.gz

Can anyone check if it is correct?

ADD COMMENT

Login before adding your answer.

Traffic: 1721 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6