I asked a form of this question previously here http://biostar.stackexchange.com/questions/3676/merging-genomic-segments-separated-by-some-distance-number-of-markers but did not get much response.
Given genomic regions (CNVs in my case) of some size or number of markers, how can I use existing resources to 1. merge them if they are near enough (by size or number of markers) and 2. bin them if they are close enough to one another (though not identical).
Some examples of my problem (the binning/merging problem) are given here: http://dl.dropbox.com/u/9445847/help.ppt
For more on the data format, see the earlier post.
Thanks, Rx.
2 answers
There is a very nice implementation of a Cluster Tree in bx-python (available on pypi)
the description in the file is:
Provides a ClusterTree data structure that supports efficient finding of clusters of intervals that are within a certain distance apart.
and you can see examples in the tests.
Another option is to use the BigBed tools from UCSC (see this paper). From there, you can write a script to query the binary format in windows and generate your binned data.
Log in to answer this question.