1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
From c602ddef45e5f4734b38ccaf36ad766ac2978273 Mon Sep 17 00:00:00 2001
From: Ryan Dale <dalerr@niddk.nih.gov>
Date: Mon, 30 Apr 2018 09:52:22 -0400
Subject: Support newer bedtools version
---
--- python-gffutils.orig/gffutils/iterators.py
+++ python-gffutils/gffutils/iterators.py
@@ -115,7 +115,6 @@
Subclass for iterating over features provided as a filename
"""
def open_function(self, data):
- data = os.path.expanduser(data)
if data.endswith('.gz'):
import gzip
return gzip.open(data)
--- python-gffutils.orig/gffutils/test/test.py
+++ python-gffutils/gffutils/test/test.py
@@ -1315,6 +1315,18 @@
g = gffutils.feature.feature_from_line(str(f))
assert g == f
+
+def test_issue_105():
+ fn = gffutils.example_filename('FBgn0031208.gtf')
+ home = os.path.expanduser('~')
+ newfn = os.path.join(home, '.gffutils.test')
+ with open(newfn, 'w') as fout:
+ fout.write(open(fn).read())
+ f = gffutils.iterators.DataIterator(newfn)
+ for i in f:
+ pass
+ os.unlink(newfn)
+
if __name__ == "__main__":
# this test case fails
#test_attributes_modify()
|