This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Removing multi-variant records from vcf file

I am using gatk ASEReadCounter to get the read counts per allele. To do so, I used the following command:

gatk ASEReadCounter  -R /path_to_genome/hg38_genome/GRCh38.p13.genome.fa  -I sample.sorted.bam
-V sample.vcf.gz  -O output.table

I used GATK4. but I realized In my VCF at position chr1:1574033, there are more than one variant record in the VCF. This is not accepted by ASEReadCounter. if it was only one, I could do it manually but the question is how can I remove those rows if many rows have more than one variant record. does GATK have such ability? the row in my vcf file looks like this:

chr1    1574033 .   AAG *,A 55.01   .   AC=1,1;AF=0.500,0.500;AN=2;DP=12;ExcessHet=3.0103;FS=0.000;MLEAC=1,1;MLEAF=0.500,0.500;MQ=60.00;QD=6.88;SOR=1.179   GT:AD:DP:GQ:PL  1/2:0,6,2:8:29:434,65,29,147,0,111
gatk vcf

I would suggest to normalize the VCF. This way multiallelic records will be flattened and each row would have only one allele. bcftools can do that.

3 answers

bcftools norm -m - sample.vcf.gz > normalized_sample.vcf

If you are handling with germline variants, pre.py in (github) Illumina/hap.py can help you normlize your vcf file almost perfectly.

If you are handling with somatic variants, try bcftools or other software. (not verified)

Another option is GATK SelectVariants and check the select-type-to-include and restrict-alleles-to parameters :

docker run -v $PWD:$PWD -w $PWD broadinstitute/gatk:4.4.0.0 gatk SelectVariants \
     -R GRCh38.genome.fa \
     -V ${SAMPLE}.vcf.gz \
     --restrict-alleles-to BIALLELIC \
     --select-type-to-include SNP \
     -O ${SAMPLE}.selectvariants.vcf.gz

Log in to answer this question.