Converting gtf format to bed format
3
1
Entering edit mode
10.1 years ago
thjnant ▴ 160

Hello,

I have a question regarding the bed file format.

To convert the gtf file format to the bed format, I am wondering about the start of the second exon of the minus strand. in the minus strand. Please look at the following example:

gtf format

chr1   exon1    1   10    +
          exon2   15   20   +
chr 1   exon1   8   11     -
           exon2   13  19    -

In the above gtf example, the fields describe the chromosome number, exon number, start of the exon, end of the exon and the strand sign.

Now to convert it to bed format:

chr1   11,6   0,14   + 
          3,8     0, ?     -

The question is that how to calculate the start of the second exon of the minus strand.

bed • 19k views
ADD COMMENT
4
Entering edit mode
10.1 years ago
Manvendra Singh ★ 2.2k

There is an easy way to do that.

Have you installed bedops?

If not, please do that. bedops would help you lot in many cases.

It has a tool

gtf2bed --do-not-sort < foo.gtf > unsorted-foo.gtf.bed

if you want to sort your output bed file, just do

gtf2bed < foo.gtf > unsorted-foo.gtf.bed

There is full on material here

HTH

ADD COMMENT
0
Entering edit mode

Hi! How about if I need UCSC BED12 format which seems different from the output of gtf2bed?

ADD REPLY
0
Entering edit mode

This issue is discussed here quite neatly: Gencode Gtf To Bed12 Or Psl

ADD REPLY
2
Entering edit mode
10.1 years ago
EagleEye 7.6k

Use this script (Works well for all Gencode GTF files > V11 upto V20)

Usage:

./convertGTF.sh InputGTF(Gencode) LEVEL(gene|transcript) OutPutDirectory

Example Gene level output:

Output 1: Table

Table format

Output 2: BED

BED format

ADD COMMENT
0
Entering edit mode

Could you please share the script again? The link you provided is not working anymore. Thank you

ADD REPLY
1
Entering edit mode
10.1 years ago
Amy ▴ 20

Hi, I found a script which works perfect on this question!

http://allaboutbioinfo.blogspot.se/2011/08/converting-cufflinks-gtf-predictions-to.html

ADD COMMENT

Login before adding your answer.

Traffic: 2723 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6