Skip to content
Andy Pohl edited this page Feb 19, 2014 · 3 revisions

The matrix program provides another way to extract data from a bigWig. If what are desired are regularly-sized regions of data surrounding given loci, then this is the program to use. The interface is similar to the aggregate program, in that a left:right specification need to be given, and options exist for using region -starts or -ends in addition to the default centering. The exception to this, is to use the up:meta:down way of running the program. In this case a tripartite matrix is created aligned at both the starts and ends, and the middle sections being an extrapolation or interpolation of respective sections, depending on the size requested. Additionally, the same k-means clustering available in the aggregate program is also available in this one. One feature that is different from the aggregate program though is the ability to tile the matrix columns in a way that reduces the output, averaging every n bases. Usage:

bwtool matrix - extract data and output in a tab-delimited way that is
   easily used as a matrix by other programs.
usage:
   bwtool matrix up:down regions.bed input1.bw,input2... output.txt
   bwtool matrix up:down regions.bed bigWigs.lst output.txt

   bwtool matrix up:meta:down regions.bed input1.bw,input2... output.txt
   bwtool matrix up:meta:down regions.bed bigWigs.lst output.txt

If more than one bigWig is specified, then the matrix from the second
matrix is fused to the first, and the third to the second, etc. in the
same left-to-right order as the comma-list of bigWigs

options:
   -keep-bed       in this case output the original bed loci in the first
                   columns of the output and output data as comma-separated
   -starts         use starts of bed regions as opposed to the middles
   -ends           use ends of bed regions as opposed to the middles
   -tiled-averages=n
                   break the up:down sized region into regions of n bases
                   and average over those subregions as the matrix.
   -long-form=labels
   -long-form-header
   -cluster=k      cluster regions with k-means where k is the number of
                   clusters
   -cluster-centroids=file
                   store the calculated cluster centroids in a file additional
                   to output.txt
Clone this wiki locally