Hi!
I has been using gene models available in UCSC Table Browser for a long time. Those are in BED12 or PSL and I made many scripts to process this kind of format, but now I want to work with the last released version of Gencode (v9) which are only in GTF format.
Do you know a script to convert GTF in BED12 or PSL?
Thanks for you help!
6 answers
The UCSC source tree has utilities for gtfToGenePred (convert a GTF file to a genePred) and genePredToPsl (Program to create fake psl alignments from genePred records). The latter can output BED with the -bedFormat option. These (like all source tree utilities) can be piped together do the conversion you are looking for. The source tree and instructions for compilation are here: http://hgdownload.cse.ucsc.edu/admin/jksrc.zip
This script may help you.
https://github.com/Czh3/NGSTools/blob/master/script/gtf2bed12.sh
Hi,
just a note that the script is a really nice idea based on UCSC tools. However, currently it's not converting to the correct format.
Your Column 11: exon start site relative to chromosome start
Bed12 Column 11: exon length
Your Column 12: exon end site relative to chromosome start
Bed12 Column 12: exon start site relative to feature start
Best wishes, Jakub
Thank you for pointing this out! Furthermore, there is also an UCSC tool genePredToBed: GitHub link. Thus you could use the output of gtfToGenePred as input of genePredToBed. Something like
gtfToGenePred input.gtf output.tmp; genePredToBed output.tmp output.bed; rm output.tmp
The gencode V9 GTF format is similar to their V3 format.
this link should help you with everything what you are looking for.
http://www.sanger.ac.uk/resources/databases/encode/gencodeformat.html
hope this helps.
Thanks for the link, now I understand the fields meaning, but I asked for some script to convert this format to BED12. Well, I think I have to write it myself...
yup. all you need to do is parse the fields and then just rearrange it for the format you want. let me know if you need help in that.
Actually, use the ucsc table browser in the Preview version of the genome browser, you select the genes/gene prediction table, then the appropriate dataset.
Select to download as bed format and you are done.
Since not much time ago I'm using the Preview version of the genome browser... I didn't know about it when I did this question!
hi, I am having the same problem to convert from gff to bed12 - since the latter is a requirement for coverageBed -split. any ideas? or should I write my own thing?
thanks!
Anna
Log in to answer this question.