View Single Post
Old 01-28-2011, 03:43 PM   #2
Senior Member
Location: Charlottesville

Join Date: Sep 2008
Posts: 119

The awesome power of awk and sed.

sed -e 's/chr//' file.vcf | awk '{OFS="\t"; if (!/^#/){print $1,$2-1,$2,$4"/"$5,"+"}}'
where you replace "file.vcf" with your file. Note this uses 0-based start coordinates, which are the proper BED format. If you want to use 1-based, change "$2-1" to just "$2".
quinlana is offline   Reply With Quote