Author Topic: Bedops closest-feature header issue  (Read 3395 times)


  • Newbie
  • *
  • Posts: 1
Bedops closest-feature header issue
« on: June 06, 2017, 08:45:56 AM »

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.


closest-features --dist --closest 100_bedops_sorted.bed DBsites060517_bedops_sorted.bed > test.bed


  • Administrator
  • Jr. Member
  • *****
  • Posts: 72
Re: Bedops closest-feature header issue
« Reply #1 on: June 06, 2017, 09:35:43 AM »
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.