bcftools merge without multiallelic sites
1
0
Entering edit mode
20 months ago
octpus616 ▴ 120

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 • 801 views
ADD COMMENT
2
Entering edit mode
20 months ago
raphael.B ▴ 520

you can pipe merge in norm

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

Login before adding your answer.

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