Converting MNP to SNP
2
1
Entering edit mode
6.5 years ago

Hello,

I do Variant Calling with freebayes. For comparison with another vcf from another source I need to split called mnp to snp.

For example freebayes called this:

chr2    21232803    .   TG  CA,CG

But I need this:

chr2    21232803    .   T   C   
chr2    21232804    .   G   A

How can I do this?

fin swimmer

vcf SNP freebayes • 5.6k views
ADD COMMENT
1
Entering edit mode

Try bcftools norm with m - option.

ADD REPLY
0
Entering edit mode

Thanks for your answer.

But this option for bcftools just spilt the multiallelic entry in two seperate lines, resulting in

chr2    21232803    .   TG  CA
chr2    21232803    .   TG  CG

fin swimmer

ADD REPLY
6
Entering edit mode
6.4 years ago

here is the solution to your problem with bcftools and vt and I added an extra record to check the program: (For some reason latest version of vt is crashing on decompose function. Hence bcftools was used. Otherwise, vt alone is fine for this solution)

$ bcftools norm -m -both test.vcf.gz  | vt  decompose_blocksub - -o output.vcf

output ( VCF headers are not shown):

#CHROM  POS ID  REF ALT QUAL    FILTER  INFO
2   21232803    .   T   C   .   .   OLD_CLUMPED=2:21232803:TG/CA
2   21232803    .   T   C   .   .   OLD_CLUMPED=2:21232803:TG/CG
2   21232804    .   G   A   .   .   OLD_CLUMPED=2:21232803:TG/CA
20  763837  .   C   T   .   .   OLD_CLUMPED=20:763837:CA/TG
20  763838  .   A   G   .   .   OLD_CLUMPED=20:763837:CA/TG

input ( VCF headers are not shown):

#CHROM  POS ID  REF ALT QUAL    FILTER  INFO
2   21232803    .   TG  CA,CG
20  763837  .   CA  TG
ADD COMMENT
0
Entering edit mode

Thanks a lot! That looks the way I like I want it. I try it out the next days.

fin swimmer

ADD REPLY
3
Entering edit mode
3.6 years ago
jena ▴ 290

I would try vcfallelicprimitives from vcflib, especially given that vcflib is from the same author as freebayes.

In fact, the author of freebayes even has a section in the manual about this topic.

ADD COMMENT
0
Entering edit mode

nice answer

ADD REPLY

Login before adding your answer.

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