Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntervalIterator doesn't reset when instantiating from list of Intervals #73

Closed
richardxia opened this issue Jan 17, 2013 · 2 comments
Closed

Comments

@richardxia
Copy link

When a BedTool is instantiated from a list of intervals, it seems that you can only iterate over it once, including from any instance methods which happen to use the iterator.

Failing code:

import pybedtools
a = pybedtools.BedTool([pybedtools.Interval('chr1', 0, 1)])
print len(a)
print len(a)

The first print statement returns 1, while the second returns 0. This causes major problems if you want to use an instance method that relies on the iterator, such as field_count() and intersect().

System information

pybedtools: v0.6.2
OS X 10.8

@daler daler closed this as completed in de56a62 Jan 17, 2013
@daler
Copy link
Owner

daler commented Jan 17, 2013

Thanks for reporting this, can you give de56a62 a try?

@richardxia
Copy link
Author

Thanks, that looks like it fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants