-
Notifications
You must be signed in to change notification settings - Fork 22
fill
Andy Pohl edited this page Oct 29, 2013
·
8 revisions
This is one of the simpler programs in the bwtool suite. All it does is fill missing regions of a bigWig. Missing regions are defined by the bigWig's internal list of chromosomes and chromosome sizes. To check this internal list, one must use the bigWigInfo program available from UCSC with the -chroms parameter. By default, the whole bigWig is filled, but if specific regions are specified with -regions or a slice of the data is specified on the command-line, then the output is restricted accordingly.
Usage message:
bwtool fill - fill given sections or whole chromosomes with
a given value anywhere there is no data.
usage:
bwtool fill <val> input.bw[:chr:start-end] output.bw
Consider the typical example:
According to bigWigInfo -chroms
, there are 36 bases in one chromosome:
$ bigWigInfo -chroms main.bigWig -chroms
version: 4
isCompressed: yes
isSwapped: 0
primaryDataSize: 151
primaryIndexSize: 6,212
zoomLevels: 2
chromCount: 1
chr 0 36
basesCovered: 32
mean: 3.750000
min: 0.000000
max: 10.000000
std: 2.016065
Running bwtool fill with zero will cover the missing 4 bases:
$ bwtool fill 0 main.bigWig filled.bigWig -wigtype=bg
$ bigWigInfo filled.bigWig -chroms
version: 4
isCompressed: no
isSwapped: 0
primaryDataSize: 176
primaryIndexSize: 6,204
zoomLevels: 2
chromCount: 1
chr 0 36
basesCovered: 36
mean: 3.333333
min: 0.000000
max: 10.000000
std: 2.242448
Just to check that bases 24-27 are now 0:
$ bigWigToWig filled.bigWig /dev/stdout -start=20
#bedGraph section chr:0-36
chr 20 21 2
chr 21 22 2
chr 22 23 1
chr 23 24 0
chr 24 25 0
chr 25 26 0
chr 26 27 0
chr 27 28 2
chr 28 29 3
chr 29 30 4
chr 30 31 6
chr 31 32 6
chr 32 33 4
chr 33 34 4
chr 34 35 4
chr 35 36 2