we do a lot of work on overlapping genomic features.
Bedtool is a great tool for this kind of task, but sometimes I want to implement it with python
for some custom usage. I found many useful links below. I have to digest them to fully understand how the tree is constructed.
http://blog.nextgenetics.net/?e=45
http://hackmap.blogspot.com/2008/11/python-interval-tree.html
http://psaffrey.wordpress.com/2011/04/
http://www.biostars.org/p/2244/
I am by no means familiar with those algorithms. Have a peek how other people do it, and learn from them is a good start for me.
Wow!