ChIP Analysis


bigwigCompare --outFileName FILENAME --bigwig1 BigWigFile1 --bigwig2 BigWigFile2 [options]


bigwigCompare is a tool from the deepTools suite. The information on this page is based on deepTools version 3.5.1.

This tool compares two bigWig files based on the number of mapped reads. To compare the bigwig files, the genome is partitioned into bins of equal size, then the scores (e.g., number of reads) found in each bigWig file are counted for such bins and, finally, a summary value is reported. This value can be the ratio of the number of reads per bin, the log2 of the ratio, the sum or the difference.

Required Arguments

  • --bigwig1 Bigwig file, -b1 Bigwig file: Bigwig file 1. Usually the file for the treatment.
  • --bigwig2 Bigwig file, -b2 Bigwig file: Bigwig file 2. Usually the file for the control.
  • --outFileName FILENAME, -o FILENAME: Output file name.


  • --scaleFactors SCALEFACTORS: Set this parameter to multipy the bigwig values by a constant. The format is scaleFactor1:scaleFactor2. For example 0.7:1 to scale the first bigwig file by 0.7 while not scaling the second bigwig file (default: None)
  • --pseudocount PSEUDOCOUNT [PSEUDOCOUNT ...]: A small number to avoid x/0. Only useful together with --operation log2 or --operation ratio. You can specify different values as pseudocounts for the numerator and the denominator by providing two values (the first value is used as the numerator pseudocount and the second the denominator pseudocount). (Default: 1)
  • --skipZeroOverZero: Skip bins where BOTH BAM files lack coverage. This is determined BEFORE any applicable pseudocount is added. (default: False)
  • --operation {log2,ratio,subtract,add,mean,reciprocal_ratio,first,second}: The default is to output the log2ratio of the two samples. The reciprocal ratio returns the the negative of the inverse of the ratio if the ratio is less than 0. The resulting values are interpreted as negative fold changes. Instead of performing a computation using both files, the scaled signal can alternatively be output for the first or second file using the --operation first or --operation second (Default: log2)
  • --skipNonCoveredRegions, --skipNAs: This parameter determines if non-covered regions (regions without a score) in the bigWig files should be skipped. The default is to treat those regions as having a value of zero. The decision to skip non-covered regions depends on the interpretation of the data. Non-covered regions in a bigWig file may represent repetitive regions that should be skipped. Alternatively, the interpretation of non-covered regions as zeros may be wrong and this option should be used (default: False)
  • --binSize INT bp, -bs INT bp: Size of the bins, in bases, for the output of the bigwig/bedgraph file. (Default: 50)
  • --region CHR:START:END, -r CHR:START:END: Region of the genome to limit the operation to - this is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example --region chr10 or --region chr10:456700:891000. (default: None)
  • --blackListFileName BED file [BED file ...], -bl BED file [BED file ...]: A BED or GTF file containing regions that should be excluded from all analyses. Currently this works by rejecting genomic chunks that happen to overlap an entry. Consequently, for BAM files, if a read partially overlaps a blacklisted region or a fragment spans over it, then the read/fragment might still be considered. Please note that you should adjust the effective genome size, if relevant. (default: None)
  • --numberOfProcessors INT, -p INT: Number of processors to use. Type max/2 to use half the maximum number of processors or max to use all available processors. (Default: 1)
  • --outFileFormat {bigwig,bedgraph}, -of {bigwig,bedgraph}: Output file type. Either bigwig or bedgraph. (default: bigwig)
  • --deepBlueURL DEEPBLUEURL: For remote files bedgraph/wiggle files hosted on deepBlue, this specifies the server URL. The default is "", which should not be changed without good reason. (default:
  • --userKey USERKEY: For remote files bedgraph/wiggle files hosted on deepBlue, this specifies the user key to use for access. The default is "anonymous_key", which suffices for public datasets. If you need access to a restricted access/private dataset, then request a key from deepBlue and specify it here. (default: anonymous_key)
  • --deepBlueTempDir DEEPBLUETEMPDIR: If specified, temporary files from preloading datasets from deepBlue will be written here (note, this directory must exist). If not specified, where ever temporary files would normally be written on your system is used. (default: None)
  • --deepBlueKeepTemp: If specified, temporary bigWig files from preloading deepBlue datasets are not deleted. A message will be printed noting where these files are and what sample they correspond to. These can then be used if you wish to analyse the same sample with the same regions again. (default: False)
  • --version: show program's version number and exit
  • -h, --help: show this help message and exit
  • --verbose, -v: Set to see processing messages. (default: False)


Assume you want to calculate the log2 foldchange values for a STARR-seq or ChIP-seq experiment, you have your treatment library (for ChIP-seq) or RNA library (for STARR-seq) stored in a bigWig file called, and input/control library (for ChIP-seq) or DNA library (for STARR-seq) stored in a bigWig file called You can generate the desired bigwig file with the following command:

bigwigCompare --bigwig1 --bigwig2 --operation log2

You may also be interested in bamCompare which normalizes 2 BAM files to each other.


Share your experience or ask a question