expand varians in a vcf file
1
1
Entering edit mode
2.5 years ago
BioDH ▴ 10

Hi all,

I have a vcf file looks like

chr22   31600460        rs2413035       T       C,TCTTCATCAGCCTTCTCCTCCTCTTCCTC .        <blah blah>

I'm trying to expand the two variants into two seperate rows like

 chr22   31600460        rs2413035       T       C .        <blah blah>
 chr22   31600460        rs2413035       T       TCTTCATCAGCCTTCTCCTCCTCTTCCTC .        <blah blah>

Of course I want other fields(INFO, FORMAT) to be expanded accordingly. "genotype" has to be expanded as well.

Does anyone have any idea or comments?

Thanks.

expand vcf • 777 views
ADD COMMENT
1
Entering edit mode
2.5 years ago
iraun 6.2k

You can use bcftools norm for splitting multi-allelic variants, try something like this:

bcftools norm -Ov -m-any input.vcf > output.vcf
ADD COMMENT
0
Entering edit mode

It works. Thanks a lot.

ADD REPLY
0
Entering edit mode

Perfect, please accept the answer so that the question is marked as solved :)

ADD REPLY

Login before adding your answer.

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