Category

Format Conversion


Usage

bedGraphToBigWig [options] in.bedGraph chrom.sizes out.bw


Manual

This tool is part of UCSC Genome Browser's utilities.

Required arguments

  • in.bedGraph: a four column file in the format: <chrom> <start> <end> <value> (columns are separated by Tab).
  • chrom.sizes: a two column file/URL: <chromosome name> <size in bases> (columns are separated by Tab).
    Note: all chromosomes present in in.bedGraph must have the corresponding chromosome sizes defined in the chrom.sizes file; otherwise errors like
    GL000009.2 is not found in chromosome sizes file
    will be raised. In the above case, the records on the same chromosome are named differently in the in.bedGraph (as GL000009.1) and in the chromosome size file (as chrGL000009.2). To fix this problem, you need to either change the names in the in.bedGraph or in the chrom.sizes.
  • out.bw: the output indexed bigwig file.

Options

  • -blockSize=N: Number of items to bundle in r-tree. Default 256
  • -itemsPerSlot=N: Number of data points bundled at lowest level. Default 1024
  • -unc: If set, do not use compression.

If the assembly is hosted by UCSC, chrom.sizes can be a URL like https://hgdownload.soe.ucsc.edu/goldenPath/db/bigZips/db.chrom.sizes, for example, if you want to get the chromsome sizes for chromosomes defined in hg38, you can access https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.chrom.sizes. Or you may use the script fetchChromSizes to download the chrom.sizes file. If not hosted by UCSC, a chrom.sizes file can be generated by running twoBitInfo on the assembly .2bit file.

The input bedGraph file must be sorted, use the unix sort command:

$ sort -k1,1 -k2,2n unsorted.bedGraph > sorted.bedGraph

Protocols using this tool

ENCODE RNA-seq (paired-end)
File formats this tool works with
bedGraph

Share your experience or ask a question