Package: python-intervaltree-bio / 1.0.1-4

0001-Replace-all-.search-calls-with-.overlap-in-tests-and.patch Patch series | 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
From: Hilko Bengen <bengen@debian.org>
Date: Sat, 26 Jan 2019 22:56:49 +0100
Bug-Debian: https://bugs.debian.org/920545
Subject: [PATCH] Replace all .search() calls with .overlap()  in tests and
 documentation

---
 README.rst                       |  2 +-
 intervaltree_bio/__init__.py     | 10 +++++-----
 tests/genomeintervaltree_test.py |  4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

--- a/README.rst
+++ b/README.rst
@@ -34,7 +34,7 @@ The core example is loading the transcri
 
 It is then possible to use the data structure to search known genes within given intervals::
 
-    >> result = knownGene[b'chr1'].search(100000, 138529)
+    >> result = knownGene[b'chr1'].overlap(100000, 138529)
     
 It is possible to load other UCSC tables besides ``knownGene`` or specify custom URL or file to read the table from.
 Consult the docstring of the ``GenomeIntervalTree.from_table`` method for more details.
--- a/intervaltree_bio/__init__.py
+++ b/intervaltree_bio/__init__.py
@@ -125,10 +125,10 @@ class GenomeIntervalTree(defaultdict):
             >>> gtree = GenomeIntervalTree.from_bed(BytesIO(data))
             >>> len(gtree)
             1732
-            >>> assert gtree[b'chr10'].search(22610878) == set([Interval(22610878, 22611813, [b'.', b'1000', b'.', b'471.725544438908', b'-1', b'3.21510858105313', b'389']), Interval(22610878, 22611813, [b'.', b'791', b'.', b'123.885507169449', b'-1', b'3.21510858105313', b'596'])])
-            >>> assert gtree[b'chr10'].search(22611813) == set([])
-            >>> assert gtree[b'chr1'].search(145036590, 145036594) == set([Interval(145036593, 145037123, [b'.', b'247', b'.', b'38.6720804428054', b'-1', b'3.06233123683911', b'265'])])
-            >>> assert gtree[b'chr10'].search(145036594, 145036595) == set([])
+            >>> assert gtree[b'chr10'].overlap(22610878) == set([Interval(22610878, 22611813, [b'.', b'1000', b'.', b'471.725544438908', b'-1', b'3.21510858105313', b'389']), Interval(22610878, 22611813, [b'.', b'791', b'.', b'123.885507169449', b'-1', b'3.21510858105313', b'596'])])
+            >>> assert gtree[b'chr10'].overlap(22611813) == set([])
+            >>> assert gtree[b'chr1'].overlap(145036590, 145036594) == set([Interval(145036593, 145037123, [b'.', b'247', b'.', b'38.6720804428054', b'-1', b'3.06233123683911', b'265'])])
+            >>> assert gtree[b'chr10'].overlap(145036594, 145036595) == set([])
             
         '''
         # We collect all intervals into a set of lists, and then put them all at once into the tree structures
@@ -187,7 +187,7 @@ class GenomeIntervalTree(defaultdict):
         >> knownGene = GenomeIntervalTree.from_table()
         >> len(knownGene)
         82960
-        >> result = knownGene[b'chr1'].search(100000, 138529)
+        >> result = knownGene[b'chr1'].overlap(100000, 138529)
         >> len(result)
         1
         >> list(result)[0].data['name']
--- a/tests/genomeintervaltree_test.py
+++ b/tests/genomeintervaltree_test.py
@@ -23,7 +23,7 @@ def test_knownGene(base_url):
     knownGene_localurl = 'file:///%s' % os.path.abspath(knownGene_file)
     knownGene = GenomeIntervalTree.from_table(url=knownGene_localurl, decompress=True) # Py3 downloads .gz files to local files with names not ending with .gz
     assert len(knownGene) == 82960
-    result = knownGene[b'chr1'].search(100000, 138529)
+    result = knownGene[b'chr1'].overlap(100000, 138529)
     assert len(result) == 1
     assert list(result)[0].data['name'] == b'uc021oeg.2'
     
@@ -33,7 +33,7 @@ def test_knownGene(base_url):
     
     knownGene = GenomeIntervalTree.from_table(url=knownGene_localurl, mode='exons', decompress=True)
     assert len(knownGene) == 742493
-    result = list(knownGene[b'chr1'].search(134772, 140566))
+    result = list(knownGene[b'chr1'].overlap(134772, 140566))
     assert len(result) == 3
     assert result[0].data == result[1].data and result[0].data == result[2].data