File: newer_bedtools

package info (click to toggle)
python-gffutils 0.11.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 10,116 kB
  • sloc: python: 5,395; makefile: 54; sh: 13
file content (38 lines) | stat: -rw-r--r-- 1,086 bytes parent folder | download
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
38
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

---
--- a/gffutils/iterators.py
+++ b/gffutils/iterators.py
@@ -121,7 +121,7 @@ class _FileIterator(_BaseIterator):
         return initial
 
     def open_function(self, data):
-        data = os.path.expanduser(data)
+        #data = os.path.expanduser(data)
         if data.endswith(".gz"):
             import gzip
 
--- a/gffutils/test/test.py
+++ b/gffutils/test/test.py
@@ -1237,6 +1237,18 @@ def test_db_unquoting():
     assert db["f"]["Note"] == [","]
 
 
+
+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()