Reference Code backup Executable files
Extend length of entries in bed 6+ data to be at least the given length, taking strand directionality into account.
bedExtendRanges database length files(s)
This tool is part of UCSC Genome Browser's utilities.
The bedExtendRanges command extends the length of entries in BED 6+ data to be at least the given length, taking strand directionality into account.
Expecting at least 6 words line 1 of stdin got 3will be raised.
By default, bedExtendRanges extends certain bps (as defined by the length argument) from the start of each region. In the following case, regions will be redefined as starting from their original starts and stopping at 250-bp downstream to the starts.
Here is the input file for the demostration:
$ head input.bed chr1 500 525 . 100 + chr1 1000 1025 . 100 -
Now let's do the extension:
$ bedExtendRanges hg18 250 input.bed > output.bed Reading input.bed chr1 500 750 . 100 + chr1 775 1025 . 100 - # this is equivalent to the following bedExtendRanges-user=genome
-host=genome-mysql.cse.ucsc.edu
hg18 250 input.bed > output.bed
If you want to get rid of the line "Reading xxx", just redirect standard error to /dev/null:
$ cat input.bed | bedExtendRanges hg18 250 stdin 2> /dev/null chr1 500 750 . 100 + chr1 775 1025 . 100 -
If you leave the strand field in the input file as ., then bedExtendRanges extends certain bps (as defined by the $\frac{length}{2}$) from the center of each region.
$ head input.bed chr1 500 526 . 100 . chr1 1000 1126 . 100 . $ cat input.bed | bedExtendRanges hg18 250 stdin Reading stdin chr1 388 638 . 100 . chr1 938 1188 . 100 .