Question: Method to merge two vcf files that don't have same alt information
0
gravatar for Apprentice
4.2 years ago by
Apprentice40
Apprentice40 wrote:

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.7k views
ADD COMMENTlink modified 4.2 years ago by Vivek2.4k • written 4.2 years ago by Apprentice40
2
gravatar for Vivek
4.2 years ago by
Vivek2.4k
Denmark
Vivek2.4k wrote:

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 COMMENTlink modified 4.2 years ago • written 4.2 years ago by Vivek2.4k

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 REPLYlink written 4.2 years ago by Apprentice40

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 REPLYlink written 4.2 years ago by Vivek2.4k

Thank you for your advice.

I'll try it

ADD REPLYlink written 4.2 years ago by Apprentice40
1

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

ADD REPLYlink written 4.1 years ago by Apprentice40
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 934 users visited in the last hour