I have vcf files with exactly same meta region as well as same column names for fix and gt region but different variants. I want to merge them into a single file vcf file with same meta and combined fixed and gt region.like this :
file1.vcf
##fileformat=VCFv4.1
##FILTER=<ID=PASS,Description="Passed all filters">
##INFO=<ID=DP,Number=1,Type=Integer,Description="Total Read Depth">
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT S1 S2 S3
1 10 . C A . . DP=3;CALLER=Samtools GT 0/1 0/0 0/1
1 11 . C A . . DP=3;CALLER=Samtools GT . . 1/1
1 12 . C A . . DP=3;CALLER=Samtools GT 0/0 0/0 0/0
1 13 . C A . . DP=3;CALLER=Samtools GT 0/1 1/1 1/1
file2.vcf
##fileformat=VCFv4.1
##FILTER=<ID=PASS,Description="Passed all filters">
##INFO=<ID=DP,Number=1,Type=Integer,Description="Total Read Depth">
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT S1 S2 S3
1 14 . C A . . DP=3;CALLER=Samtools GT 0/1 0/0 0/1
1 15 . C A . . DP=3;CALLER=Samtools GT . . 1/1
1 16 . C A . . DP=3;CALLER=Samtools GT 0/0 0/0 0/0
1 17 . C A . . DP=3;CALLER=Samtools GT 0/1 1/1 1/1
merged.vcf
##fileformat=VCFv4.1
##FILTER=<ID=PASS,Description="Passed all filters">
##INFO=<ID=DP,Number=1,Type=Integer,Description="Total Read Depth">
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT S1 S2 S3
1 10 . C A . . DP=3;CALLER=Samtools GT 0/1 0/0 0/1
1 11 . C A . . DP=3;CALLER=Samtools GT . . 1/1
1 12 . C A . . DP=3;CALLER=Samtools GT 0/0 0/0 0/0
1 13 . C A . . DP=3;CALLER=Samtools GT 0/1 1/1 1/1
1 14 . C A . . DP=3;CALLER=Samtools GT 0/1 0/0 0/1
1 15 . C A . . DP=3;CALLER=Samtools GT . . 1/1
1 16 . C A . . DP=3;CALLER=Samtools GT 0/0 0/0 0/0
1 17 . C A . . DP=3;CALLER=Samtools GT 0/1 1/1 1/1
What have you tried? Have you checked vcftools/bcftools? Also, please use the formatting bar (especially the
code
option) to present your post better. I've done it for you this time.