"metagene" intervals associated with a given interval (input, in bed format) is the set of intervals positioned with respect to the input interval. This allows for metagene/waterfall plots to be made.
- Strand-aware
- normalize different input interval length
- option to center on the middle of interval
- option to fold with respect to boundary
python wzmetagene.py interval_bed_file
$ echo -e "chr1\t10000\t10200" | python wzmetagene.py - -n 3 -m 0
chr1 10000 10066 0 0-33% 0 chr1 10000 10200
chr1 10066 10133 1 33-66% 0 chr1 10000 10200
chr1 10133 10200 2 66-100% 0 chr1 10000 10200
The flanking sequence is 1kb in length and specified by -f
.
$ echo -e "chr1\t10000\t10200" | python wzmetagene.py - -n 3 -m 2 -f 1000
chr1 9500 10000 -1 (-500)-(0) -1 chr1 10000 10200
chr1 9000 9500 -2 (-1000)-(-500) -1 chr1 10000 10200
chr1 10000 10066 0 0-33% 0 chr1 10000 10200
chr1 10066 10133 1 33-66% 0 chr1 10000 10200
chr1 10133 10200 2 66-100% 0 chr1 10000 10200
chr1 10200 10700 3 0-500 1 chr1 10000 10200
chr1 10700 11200 4 500-1000 1 chr1 10000 10200
The strand column is given in -s
.
$ echo -e "chr1\t10000\t10200\t-" | python wzmetagene.py - -n 3 -m 2 -f 1000 -s 4
chr1 10200 10700 -1 (-500)-(0) -1 chr1 10000 10200 -
chr1 10700 11200 -2 (-1000)-(-500) -1 chr1 10000 10200 -
chr1 10000 10066 2 66-100% 0 chr1 10000 10200 -
chr1 10066 10133 1 33-66% 0 chr1 10000 10200 -
chr1 10133 10200 0 0-33% 0 chr1 10000 10200 -
chr1 9500 10000 3 0-500 1 chr1 10000 10200 -
chr1 9000 9500 4 500-1000 1 chr1 10000 10200 -
This is done by --middle
$ echo -e "chr1\t10000\t10200\t-" | python wzmetagene.py - -n 3 -m 0 --middle
chr1 10032 10033 0 0-33% 0 chr1 10000 10200 -
chr1 10099 10100 1 33-66% 0 chr1 10000 10200 -
chr1 10165 10166 2 66-100% 0 chr1 10000 10200 -
This is achieved by --collapse
. Note it's different from --middle
which only change the output intervals.
-F
specifies the step instead of specifying the whole flanking length as by -f
.
$ echo -e "chr1\t10000\t10200" | python wzmetagene.py - -n 3 -F 400 -m 3 --collapse
chr1 9700 10100 -1 (-400)-(0) -1 chr1 10000 10200
chr1 9300 9700 -2 (-800)-(-400) -1 chr1 10000 10200
chr1 8900 9300 -3 (-1200)-(-800) -1 chr1 10000 10200
chr1 10100 10500 0 0-400 1 chr1 10000 10200
chr1 10500 10900 1 400-800 1 chr1 10000 10200
chr1 10900 11300 2 800-1200 1 chr1 10000 10200
This is achieved by --collapsecenter
.
$ echo -e "chr1\t10000\t10200" | python wzmetagene.py - -n 3 -F 400 -m 3 --collapsecenter
chr1 9500 9900 -1 (-400)-(0) -1 chr1 10000 10200
chr1 9100 9500 -2 (-800)-(-400) -1 chr1 10000 10200
chr1 8700 9100 -3 (-1200)-(-800) -1 chr1 10000 10200
chr1 9900 10300 0 0-100% 0 chr1 10000 10200
chr1 10300 10700 1 0-400 1 chr1 10000 10200
chr1 10700 11100 2 400-800 1 chr1 10000 10200
chr1 11100 11500 3 800-1200 1 chr1 10000 10200
This is done by --fold
$ echo -e "chr1\t10000\t10200" | python wzmetagene.py - -n 4 -f1000 -m 4 --fold
chr1 9750 10000 -1 (-250)-(0) -1 chr1 10000 10200
chr1 9500 9750 -2 (-500)-(-250) -1 chr1 10000 10200
chr1 9250 9500 -3 (-750)-(-500) -1 chr1 10000 10200
chr1 9000 9250 -4 (-1000)-(-750) -1 chr1 10000 10200
chr1 10000 10050 0 0-25% 0 chr1 10000 10200
chr1 10050 10100 1 25-50% 0 chr1 10000 10200
chr1 10100 10150 1 25-50% 0 chr1 10000 10200
chr1 10150 10200 0 0-25% 0 chr1 10000 10200
chr1 10200 10450 -1 (-250)-(0) -1 chr1 10000 10200
chr1 10450 10700 -2 (-500)-(-250) -1 chr1 10000 10200
chr1 10700 10950 -3 (-750)-(-500) -1 chr1 10000 10200
chr1 10950 11200 -4 (-1000)-(-750) -1 chr1 10000 10200