This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to convert bed file to vcf?

What is the best method of converting bed file to vcf? I have several bed files with different columns. Which tool allows to adapt of different bed files?

vcf bed

1 answer

use AWK, change the header, body according to your needs...

 awk 'BEGIN {printf("##fileformat=VCFv4.2\n##INFO=<ID=END,Number=1,Type=Integer>\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\n");} {printf("%s\t%s\t.\tN\tN\t.\t.\tEND=%d\n",$1,int($2)+1,$3);}' input.bed

Log in to answer this question.