Category

BigWig Manipulation


Usage

bigWigMerge [options] in1.bw in2.bw .. inN.bw out.bedGraph


Manual

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

bigWigMerge merge bigWig files by adding together the signal values.

Required arguments

  • in1.bw .. inN.bw: bigWig files to be merged.
  • out.bedGraph: Save the merged results to this bedGraph file.

Options

  • -threshold=0.N: don't output values at or below this threshold. Default is 0.0
  • -adjust=0.N: add adjustment to each value
  • -clip=NNN.N: values higher than this are clipped to this value

Notes

  • After running this command, you will have to run bedGraphToBigWig to make the output bigWig.
  • If there are negative values in any of your bigWig files, bigWigMerge will ignore these loci with non-positive values. To avoid this behavior, you need to set -threshold=-10000.0 (replace -10000.0 with a value you think is smaller than the smallest value in your file). One caveat is that loci with no signal will also be dumped; if you want to remove these records, consider using awk to do a quick filtering. Alternatively, you can use wiggletools sum to merge bigwig files, which directly handles negative values.
    # first use bigWigMerge to merge files
    # remember to override the default value of -threshold to a negative number
    bigWigMerge -threshold=-10000.0 file1_with_negative_values.bw file2_with_negative_values.bw merged.bg
    
    # use awk to remove loci with 0 signal
    awk 'BEGIN{FS="\t"}{if ($4!=0) print $0}' merged.bg > merged.filtered.bg

Examples

Merge multiple bigWig files into a single bigWig file

Assume you want to merge three bigWig files (a.bw, b.bw, and c.bw) into a single one (merged.bw). This will involve two tools bigWigMerge and bedGraphToBigWig:

$ bigWigMerge a.bw b.bw c.bw merged.bg

$ bedGraphToBigWig merged.bg hg38.chrom.sizes merged.bw

 

File formats this tool works with
bigWig

Share your experience or ask a question