This is a test version of Biostars. For the public version, visit https://www.biostars.org.
expand varians in a vcf file

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

1 answer

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

bcftools norm -Ov -m-any input.vcf > output.vcf

It works. Thanks a lot.

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

Log in to answer this question.