Applications of BEDOPS > bedops
Bedops closest-feature header issue
(1/1)
rbronste:
Hi,
In getting the output for this, since it doesn't print a header having a hard time discerning all of the different output columns are in the BED file, is there a way to print a header for this? Just looking to see distance from closest features, and those are options I have invoked. Including an example of the output and command below. Thanks.
Rob.
closest-features --dist --closest 100_bedops_sorted.bed DBsites060517_bedops_sorted.bed > test.bed
https://dl.dropboxusercontent.com/u/105647823/test.bed
sjn:
Thanks for joining the forum.
The tab delimited columns are your inputs.
The default output delimiter is '|'. You have 3 columns, the reference element is the first one, which has 12 tab-delimited columns or so. The second column is the closest element, which has 5 tab-delimited columns or so, and then the 3rd column is the distance.
You can suppress the first column (reference element) using the --no-ref option. If you are solely looking for the distances and do not care about the actual element information, then you can use the `cut` command:
closest-features --dist --closest 100_bedops_sorted.bed DBsites060517_bedops_sorted.bed | cut -f3 -d'|' > test.out
or, if you include --no-ref:
closest-features -no-ref --dist --closest 100_bedops_sorted.bed DBsites060517_bedops_sorted.bed | cut -f2 -d'|' > test.out
If you are interested in the closest element, then no `cut` is needed.
You can change the output delimiter using the --delim option.
Navigation
[0] Message Index
Go to full version