How to convert GTF format into BED12 or BIGBED format?

#see below for UPDATES that include more shorter ways of conversions

#How to convert GTF format into BED12 format (Human-hg19)?

#How to convert GTF or BED format into BIGBED format?

#Why BIGBED (If GTF or BED file is very large to upload in UCSC, you can use trackHubs. However trackHubs do not accept either of the formats. Therefore you would need bigBed format)

#First, download UCSC scripts

wget http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/gtfToGenePred

wget http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/genePredToBed

wget http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/bedToBigBed

#Second, download chromosome sizes and filter out unnecessary chromosomes

wget http://hgdownload.cse.ucsc.edu/goldenPath/hg19/bigZips/hg19.chrom.sizes

grep -v chrM hg19.chrom.sizes|grep -v _hap|grep -v Un_gl|grep -v random>hg19.chrom.filtered.sizes

rm hg19.chrom.sizes

#Third, make them executable

chmod +x gtfToGenePred genePredToBed bedToBigBed

#Convert Gtf to genePred

./gtfToGenePred 1st_53_tissues.combined.gtf 1st_53_tissues.combined.genePred

#Convert genPred to bed12

./genePredToBed 1st_53_tissues.combined.genePred 1st_53_tissues.combined.bed12

#sort bed12

sort -k1,1 -k2,2n 1st_53_tissues.combined.bed12>1st_53_tissues.combined.sorted.bed

#Convert sorted bed12 to bigBed (useful for trackhubs)

./bedToBigBed 1st_53_tissues.combined.sorted.bed hg19.chrom.filtered.sizes 1st_53_tissues.combined.bb

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 本文资料来源 https://web.archive.org/web/20161125133249/http://...
    x2yline阅读 7,823评论 0 4
  • ANNOVAR的安装 ANNOVAR网址 log in之后才能download,使用教育机构后缀的邮箱即可注册。 ...
    面面的徐爷阅读 23,302评论 1 26
  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 12,167评论 0 10
  • 穿过密林达顶端,景物浓缩眼底宽。 汽车大小一厘米,楼群各异积木盘。
    老槐树阅读 1,274评论 0 2
  • 礼貌是指塑造人际关系的能力。礼貌的表现形式是言行举止。一个人通过自己的言行举止表现他对社会行为规范的承认,表现他对...
    寇廷聚阅读 2,812评论 0 2

友情链接更多精彩内容