Method to merge two vcf files that don't have same alt information
1
0
Entering edit mode
8.3 years ago
Apprentice ▴ 170

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 • 3.0k views
ADD COMMENT
2
Entering edit mode
8.3 years ago
Vivek ★ 2.7k

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.

ADD COMMENT
0
Entering edit mode

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?

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

Thank you for your advice.

I'll try it

ADD REPLY
1
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 2356 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