What Is The Best Library For Handling Interval Logic?
3
3
Entering edit mode
13.4 years ago
Casbon ★ 3.3k

What libraries are there for handling logic on intervals? I really want all the set operations on the intervals at genome scale. Bonus points if it has some persistence mechanism and can track the ancestor of an operation (i.e. interval X is the result of the intersection of Y and Z).

I looked at bx python, but the documentation is not great.

library • 3.0k views
ADD COMMENT
6
Entering edit mode
13.4 years ago

Have you tried the bioconductor packages IRanges or GenomicRanges. I have used IRanges earlier for a similar task as suggested by Jeremy.

ADD COMMENT
1
Entering edit mode

I don't think the IRanges objects track their own derivation history.

ADD REPLY
1
Entering edit mode

you can save an IRanges object using... save() Thumbs up for the most advanced interval library at present.

ADD REPLY
0
Entering edit mode

Looks pretty good, but how does persistence work with the ranges, or do you need to manually convert each time?

ADD REPLY
0
Entering edit mode

@Casbon: +1 David. Not sure about the persistence mechanism.

ADD REPLY
2
Entering edit mode
13.2 years ago

Ryan Dale recently released a Python wrapper for BEDtools called pybedtools. BEDTools supports all common genome arithmetic (intersect, merge, complement, join, subtract, etc.) and the Python wrapper would make it relatively simple for you to define a derivation history for the result of each operation.

ADD COMMENT
0
Entering edit mode
5.0 years ago
endrebak ▴ 960

I am partial to https://github.com/biocore-ntnu/pyranges

ADD COMMENT

Login before adding your answer.

Traffic: 1771 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6