This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Method to merge two vcf files that don't have same alt information

Hi

I have two vcf files that file names are A.vcf and B.vcf.

A.vcf


CHROM POS ID REF ALT QUAL FILTER INFO FORMAT SampleB SampleA chr1 762560 SNV_1 G T . . . GT:AD:DP:RGQ 0/0:31,0:31:81:0,81,1215 0/1:18,12:30:99:375,0,544


B.vcf


CHROM POS ID REF ALT QUAL FILTER INFO FORMAT SampleB SampleA chr1 762560 SNV_2 G . . . . GT:DP:RGQ 0/0:19:51 0/0:23:63


As you see above, SNV_1 in A.vcf and SNV_2 in B.vcf are SNVs on the same position. However SNV_1 has Alt info "T", but SNV_2 doesn't have Alt info. Thus, SNV_2 in B.vcf doesn't have AD info in genotype data.

I would like to know how to merge these two vcf files into one vcf file, recognizing SNV_A and SNV_B as same variant data.

Could you give me any advice?

next-gen

1 answer

You would likely just retain the alternate allele as T in the merged VCF and the genotype for samples in B.vcf will be 0/0 as both samples are shown to be homozygous reference for this locus. As long as both VCFs are generated with respect to the same reference genome you'll be fine.

Hi Vivek! Thank you for your quick reply. I made a mistake about sample name in B.vcf.


Correct B.vcf is as below: CHROM POS ID REF ALT QUAL FILTER INFO FORMAT SampleC SampleD chr1 762560 SNV_2 G . . . . GT:DP:RGQ 0/0:19:51 0/0:23:63


So I merge two files with different alt allele and different sample. Could you give me any advice?

It seems like there is no alt allele in B.vcf since both samples, C & D appear to be homozygous reference.

If you are worried about convention, you should try merging them with something like GATK's combine variants module and see how that goes.

Thank you for your advice.

I'll try it

Using GATK's combine variants, I could merged vcf files that don't have same alt information. Thank you for your help!

Log in to answer this question.