Question: Converting gtf format to bed format
1
gravatar for thjnant
4.8 years ago by
thjnant90
Germany
thjnant90 wrote:

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 • 11k views
ADD COMMENTlink modified 4.8 years ago by Amy10 • written 4.8 years ago by thjnant90
4
gravatar for Manvendra Singh
4.8 years ago by
Manvendra Singh2.1k
Berlin, Germany
Manvendra Singh2.1k wrote:

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

https://bedops.readthedocs.org/en/latest/content/reference/file-management/conversion/gtf2bed.html

HTH 

ADD COMMENTlink written 4.8 years ago by Manvendra Singh2.1k

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

  

ADD REPLYlink written 4.8 years ago by Amy10

This issue is discussed here quite neatly

Gencode Gtf To Bed12 Or Psl

 

ADD REPLYlink written 4.8 years ago by Manvendra Singh2.1k
2
gravatar for EagleEye
4.8 years ago by
EagleEye6.4k
Sweden
EagleEye6.4k wrote:

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

www.bioinformatics.kandurilab.org/deposits/convertGTF.sh

 

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

Example Gene level output:

Output 1: Table

Table format

Output 2: BED

BED format

ADD COMMENTlink modified 3.6 years ago • written 4.8 years ago by EagleEye6.4k
1
gravatar for Amy
4.8 years ago by
Amy10
UK
Amy10 wrote:

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

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

ADD COMMENTlink written 4.8 years ago by Amy10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1832 users visited in the last hour