Skip to content

Commit

Permalink
make randomintersection file-based again to avoid blocking reads on p…
Browse files Browse the repository at this point in the history
…ipes in some cases (i.e. a workaround for #49)
  • Loading branch information
daler committed Feb 13, 2012
1 parent cdb789c commit b1eee3d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pybedtools/bedtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -2009,10 +2009,10 @@ def randomintersection(self, other, iterations, intersect_kwargs=None,

# Re-sort if sorted=True in kwargs
if resort:
tmp0 = self.shuffle(stream=True, **shuffle_kwargs)
tmp = tmp0.sort(stream=True)
tmp0 = self.shuffle(**shuffle_kwargs)
tmp = tmp0.sort()
else:
tmp = self.shuffle(stream=True, **shuffle_kwargs)
tmp = self.shuffle(**shuffle_kwargs)

tmp2 = tmp.intersect(other, stream=True, **intersect_kwargs)

Expand All @@ -2021,9 +2021,9 @@ def randomintersection(self, other, iterations, intersect_kwargs=None,
# Close the open stdouts from subprocess.Popen calls. Note: doing
# this in self.__del__ doesn't fix the open file limit bug; it
# needs to be done here.
if resort:
tmp0.fn.close()
tmp.fn.close()
#if resort:
# tmp0.fn.close()
#tmp.fn.close()
tmp2.fn.close()
del(tmp)
del(tmp2)
Expand Down

0 comments on commit b1eee3d

Please sign in to comment.