arq5x/bedtools — pull request #9 by jakebiesinger (2011-10-25 08:09:51+00:00)
Title: Signed distance for closestBed

Hi!

I'm not sure why a signed distance wasn't present before, but it's super important for the kinds of graphs I'm trying to generate with your tools. (Don't tell me this was there before and I just missed it!)

Added a new option -D to closestBed that reports a signed distance from features in A to features in B. One caveat is that the distance depends on the strand of A. Positive strand A features behave as you might expect, but negative strand A features have upstream features that are actually "to the right" of the features in A.

I'm not sure how my check for A's strandedness fits in with BED3 land-- I'm just testing for a.strand == "+" which could be updated to check for a.strand == "-", since it looks like BED3 files have an empty "" strand.

Thanks for the tools!