SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a tool that converts TXT, BED, GFF format to VCF? LauraSmith Bioinformatics 4 03-22-2017 02:41 AM
GTF to BED converter? mmuratet Bioinformatics 7 02-20-2012 11:19 AM
convert vcf into bed format nans_bn Bioinformatics 0 08-02-2011 12:34 AM
BOAT aligner output format converter? rahul.m.dhodapkar Bioinformatics 0 06-30-2010 07:28 AM
MAQ .map alignment format converter fadista Bioinformatics 0 10-24-2008 06:27 AM

Reply
 
Thread Tools
Old 01-28-2011, 03:13 AM   #1
ketan_bnf
Member
 
Location: India

Join Date: Oct 2010
Posts: 59
Default Converter for vcf to bed format

Hi all,

Is there any converter that can convert vcf format files obtained by samtools vcfutils.pl to bed format?

Because i want predict the variant effect using varian_effect_predictor of ensemble.

##fileformat=VCFv4.0
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT GKUNU9Q04_chr1_sort.bam
chr1 46707 . A G 7.59 . DP=2;AF1=1;CI95=0.5,1;DP4=0,0,0,2;MQ=60 PL:GT:GQ 38,6,0:1/1:49
chr1 168576 . C T 4.61 . DP=2;AF1=1;CI95=0.5,1;DP4=0,0,0,2;MQ=60 PL:GT:GQ 34,6,0:1/1:49
chr1 168635 . G A 17.1 . DP=3;AF1=1;CI95=0.5,1;DP4=0,0,0,3;MQ=60 PL:GT:GQ 49,9,0:1/1:63

To

1 46707 46707 A/G +
1 168576 168576 C/T +
1 168635 168635 G/A +
ketan_bnf is offline   Reply With Quote
Old 01-28-2011, 04:43 PM   #2
quinlana
Senior Member
 
Location: Charlottesville

Join Date: Sep 2008
Posts: 119
Default

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".
quinlana is offline   Reply With Quote
Old 01-28-2011, 07: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
Old 12-18-2012, 02:57 AM   #4
Tahir Mujtaba
Junior Member
 
Location: Sweden

Join Date: Mar 2012
Posts: 4
Default GFF to BED

How to convert a GFF file intO BED format file?.
Tahir Mujtaba is offline   Reply With Quote
Old 09-03-2013, 05:43 AM   #5
dagarfield
Member
 
Location: Heidelberg, Germany

Join Date: Aug 2010
Posts: 39
Default

Maybe this will be useful?

https://code.google.com/p/bedops/wiki/vcf2bed
dagarfield is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 02:47 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO