This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bcftools merge without multiallelic sites

Hi

I have tried to use bcftools merge to merge two vcf files

# vcf a
chr1 10000 A T ..... 0/0
chr1 10003 A C ..... 1/0
chr1 10006 A G ..... 1/0
# vcf b
chr1 10000 A T ..... 0/1
chr1 10003 A T ..... 1/0
chr1 10006 A G ..... 1/1

I noted bcftools merge will output a merged vcf like

#merged vcf
chr1 10000 A T ..... 0/0 0/1
chr1 10003 A T,C ..... 1/0 1/0
chr1 10006 A G ..... 1/0 1/1

its create a multiallelic at pos 10003, but I expected

# only keep vcf a if alt not match
chr1 10000 A T ..... 0/0 0/1
chr1 10003 A T ..... 1/0 ./.
chr1 10006 A G ..... 1/0 1/1

or

# report vcf a and vcf b in different record, so that we can filter records we need
chr1 10000 A T ..... 0/0 0/1
chr1 10003 A T ..... 1/0 ./.
chr1 10003 A C ..... ./. 1/0
chr1 10006 A G ..... 1/0 1/1

Is there some easy way to do this?

Regrads

Zhang

ngs bcftools vcf

1 answer

you can pipe merge in norm

bcftools merge {vcf1} {vcf2} | bcftools norm -m- > {outvcf}

Log in to answer this question.