arq5x / bedtools

A powerful toolset for genome arithmetic.
http://code.google.com/p/bedtools/
GNU General Public License v2.0
140 stars 85 forks source link

ENH: shuffle intervals to non-overlapping locations. #76

Closed brentp closed 11 years ago

brentp commented 11 years ago

This definitely needs some review and some tests but "seems to work". It allows shuffling a set of intervals to non-overlapping locations. This may be a useful constraint, e.g. in cases where we are simulating deletions, loss-of-heterozygosity or copy-number events.

It progressively adds each interval to the _exclude map, so it may become slow (or impossible to place later intervals) when the -i BED file has many / large intervals.

arq5x commented 11 years ago

Ah, very cool. Thanks Brent. This is one of the solutions I had in mind. The downside, as you say, is that at some point for some datasets, it will become impossible to shuffle. That said, the user should understand this and I will make the documents state this clearly. After the grant dust settles, I will merge this in. Thanks!

arq5x commented 11 years ago

Really nice contribution; thanks much Brent. I owe you another beer.