This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bed to bigBed conversion

Hi all,

I am having trouble converting a bed file into a bigBed file --> how many I do this without much programming?

Thank you,
Tanni

rna-seq

1 answer

If you're using Linux, you can grab a couple of the UCSC Kent tools:

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

Make them executable:

$ chmod +x ./bedToBigBed ./fetchChromSizes

Fetch a chromosome size file for your build of interest (e.g., hg19 or hg38):

$ ./fetchChromSizes hg38 > hg38.chrom.sizes

Sort your BED file, for instance, with BEDOPS sort-bed:

$ sort-bed regions.unsorted.bed > regions.bed

Convert to bigBed:

$ ./bedToBigBed regions.bed hg38.chrom.sizes regions.bb

You might specify additional options for conversion; run bedToBigBed on its own for more information.

Hi Alex,

My bedToBigBed is giving me this error: cannot execute binary file

Are you running Linux? What version?

FYI, this is a permissions error. You can edit the permissions and run that program with the following command:

chmod +x ./bedToBigBed

Then you can run the program and see a usage message:

./bedToBigBed
bedToBigBed v. 2.8 - Convert bed file to bigBed. (bbi version: 4)
usage:
   bedToBigBed in.bed chrom.sizes out.bb
...

More direct documentation here: https://genome.ucsc.edu/goldenPath/help/bigBed.html

Log in to answer this question.