Here, I describe two kinds of genomic intervals and include source code for testing overlap and calculating distance between intervals.
I prepared some files that you might find useful. Several members of my group use them. I’d be happy to hear what you do with my files. Please contact me if you have any questions.