Hi. Interesting discussion!
On Feb 19, 12:12 pm, Istvan Albert <[email protected]> wrote: > On Feb 18, 2:25 pm, James Taylor <[email protected]> wrote: > > > As requested, I've put together an example of using the different > > intersection algorithms in bx, with some rough timings. > > Nice. I'll see how it compares to other approaches. Also maybe you've > just created the quintessetial dataset and timing that will be used to > compare all interval querying from now on.... > > On a related note I've read an interesting blog post today on using > python for interval query. > > http://www.logarithmic.net/pfh/blog/01234937824 > I've since come up with what I consider a better approach. Fast enough for my needs and easy to implement in an SQL database. http://www.logarithmic.net/pfh/blog/01235197474 At Istvan's prompting, I've tested this with James' test data set. I assumed pythonic intervals, ie lower<=x<upper. For the small-to-big test it doesn't do too badly. There's probably some room for optimization by converting from Python to C code. http://www.logarithmic.net/pfh-files/blog/01235197474/pfh_example.py Timing results on my server: Query intervals: hg18_chr1_phastConsElements44wayPlacental.bed.bz2 Target intervals: hg18_chr1_knownGene.bed.bz2 ---> Using pfh's method, pure python version Building: 0.020 seconds Using: 26.290 seconds ---> Using pfh's method, SQLite version Building: 0.130 seconds Using: 38.550 seconds Query intervals: hg18_chr1_knownGene.bed.bz2 Target intervals: hg18_chr1_phastConsElements44wayPlacental.bed.bz2 ---> Using pfh's method, pure python version Building: 2.060 seconds Using: 0.850 seconds ---> Using pfh's method, SQLite version Building: 6.890 seconds Using: 2.840 seconds cheers, Paul Harrison / VBC / Monash University --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pygr-dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pygr-dev?hl=en -~----------~----~----~----~------~----~------~--~---
