Skip to content
Andy Pohl edited this page Oct 29, 2013 · 4 revisions

Like fill, this is a very simple program. A value, N, must be specified and the data is shifted by N to all of the coordinates. N may be a negative number. Chromosome sizes stay the same as in the original bigWig, so data is clipped if it moves past the first or last base on the chromosome.

Usage message:

bwtool shift - move the data on the chromosome by N number of bases
usage:
   bwtool shift N input.bw[:chr:start-end] output.bw

Examples

The typical example:

with the data being:

variableStep chrom=chr span=1
1	1
2	2
3	5
4	6
5	5
6	3
7	3
8	5
9	5
10	5
11	6
12	6
13	0
14	2
15	3
16	3
17	10
18	4
19	4
20	2
21	2
22	2
23	1
variableStep chrom=chr span=1
28	2
29	3
30	4
31	6
32	6
33	4
34	4
35	4
36	2

We can shift it all upstream 10 bases:

$ bwtool shift -10 main.bigWig shifted.bigWig -wigtype=var
$ bigWigToWig shifted.bigWig /dev/stdout
variableStep chrom=chr span=1
1	6
2	6
3	0
4	2
5	3
6	3
7	10
8	4
9	4
10	2
11	2
12	2
13	1
variableStep chrom=chr span=1
18	2
19	3
20	4
21	6
22	6
23	4
24	4
25	4
26	2

And we can shift it the other way as well:

$ bwtool shift 10 main.bigWig shifted.bigWig -wigtype=var
$ bigWigToWig shifted.bigWig /dev/stdout
variableStep chrom=chr span=1
11	1
12	2
13	5
14	6
15	5
16	3
17	3
18	5
19	5
20	5
21	6
22	6
23	0
24	2
25	3
26	3
27	10
28	4
29	4
30	2
31	2
32	2
33	1
Clone this wiki locally