Skip to content

Commit

Permalink
+ move all but BedTool to helpers.py
Browse files Browse the repository at this point in the history
+ rename bedtool class to BedTool
+ adjust tests and imports accordingly.
  • Loading branch information
brentp committed Apr 4, 2011
1 parent 3086821 commit 0de20ba
Show file tree
Hide file tree
Showing 4 changed files with 409 additions and 397 deletions.
9 changes: 5 additions & 4 deletions pybedtools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import tempfile


from bedtool import bedtool, get_tempdir, set_tempdir, cleanup, find_tagged
from helpers import get_tempdir, set_tempdir, cleanup, find_tagged
from bedtool import BedTool
import genome_registry


Expand Down Expand Up @@ -51,7 +52,7 @@ def example_bedtool(fn):
fn = os.path.join(data_dir(), fn)
if not os.path.exists(fn):
raise ValueError, "%s does not exist" % fn
return bedtool(fn)
return BedTool(fn)

def list_example_files():
"""
Expand All @@ -63,7 +64,7 @@ def list_example_files():
>>> choices = list_example_files()
>>> assert 'a.bed' in choices
>>> bedfn = example_filename('a.bed')
>>> mybedtool = bedtool(bedfn)
>>> mybedtool = BedTool(bedfn)
>>> print mybedtool
chr1 1 100 feature1 0 +
chr1 100 200 feature2 0 +
Expand Down Expand Up @@ -117,7 +118,7 @@ def chromsizes_to_file(chromsizes, fn=None):
if fn is None:
tmpfn = tempfile.NamedTemporaryFile(prefix='pybedtools.',suffix='.tmp',delete=False)
tmpfn = tmpfn.name
bedtool.TEMPFILES.append(tmpfn)
BedTool.TEMPFILES.append(tmpfn)
fn = tmpfn
fout = open(fn,'w')
for chrom, bounds in sorted(chromsizes.items()):
Expand Down
Loading

0 comments on commit 0de20ba

Please sign in to comment.