This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Converting GTF file to UCSC-styled bed file

Hello,

I have a gff file and I wnt to convert it to UCSC styled bed file ( tab separated, 12-column). Does any one know a reliable tool that can be used for this conversion?

Thanks in advance

rna-seq genome next-gen

Hello Javad,

Did you sort out how to convert gtf to 12 column Bed file?

3 answers

Try bedops gtf2bed

I've written a gff -> 'knownGene file' converter: http://lindenb.github.io/jvarkit/Gff2KnownGene.html , however, I haven't much used it t.

$  curl -s "ftp://ftp.sanger.ac.uk/pub/gencode/Gencode_human/release_19/gencode.v19.annotation.gff3.gz" |\
    gunzip -c |\
    java -jar dist/gff2kg.jar
(...)
1826    ENST00000367917.3   chr1    +   162760522   162782607   162760590   162782210   8   162760522,162762448,162766374,162767591,162769532,162774056,162775183,162782087 162760625,162762652,162766467,162767706,162769727,162774113,162775282,162782607 gene_id=ENSG00000132196.9;transcript_id=ENST00000367917.3;gene_type=protein_coding;gene_status=KNOWN;gene_name=HSD17B7;transcript_type=protein_coding;transcript_name=HSD17B7-201;protein_id=ENSP00000356894.3;havana_gene=OTTHUMG00000034420.6;    ENST00000367917.3
(...)

There is a UCSC utility for this purpose, gtfToGenePred, which can be downloaded from the directory appropriate to your operating system here:
http://hgdownload.soe.ucsc.edu/admin/exe/

Here is a page (which mostly describes converting in the opposite direction, genePred to gtf), that describes some example usage:
http://genomewiki.ucsc.edu/index.php/Genes_in_gtf_or_gff_format#The_opposite_direction.2C_GTF_to_GenePred

If you have any questions or find any bugs in the program, feel free to send a bug report to one of the below mailing lists:

  • genome@soe.ucsc.edu for general questions (public list)
  • genome-www@soe.ucsc.edu for question concerning private data (private list)
  • genome-mirror@soe.ucsc.edu for questions concerning the setup and running of your own UCSC Genome Browser installation

ChrisL from the UCSC Genome Browser

Log in to answer this question.