View Single Post
Old 01-28-2011, 06:15 PM   #3
ketan_bnf
Member
 
Location: India

Join Date: Oct 2010
Posts: 59
Default

Quote:
Originally Posted by quinlana View Post
The awesome power of awk and sed.

Code:
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".
Thanks for reply,

if suppose i want to put "-" reverse strand instead of "+", how can i put that using vcf file?

1 46707 46707 A/G +
1 168576 168576 C/T +
1 168635 168635 G/A +
1 195648 195648 T/G -
ketan_bnf is offline   Reply With Quote