8
8
from ..godag .consts import RELATIONSHIP_SET
9
9
10
10
11
- # ------------------------------------------------------------------------------------
12
11
def get_go2parents (go2obj , relationships ):
13
12
"""Get set of parents GO IDs, including parents through user-specfied relationships"""
14
13
if (
@@ -28,7 +27,6 @@ def get_go2parents(go2obj, relationships):
28
27
return go2parents
29
28
30
29
31
- # ------------------------------------------------------------------------------------
32
30
def get_go2children (go2obj , relationships ):
33
31
"""Get set of children GO IDs, including children through user-specfied relationships"""
34
32
if (
@@ -48,7 +46,6 @@ def get_go2children(go2obj, relationships):
48
46
return go2children
49
47
50
48
51
- # ------------------------------------------------------------------------------------
52
49
def get_go2parents_isa (go2obj ):
53
50
"""Get set of immediate parents GO IDs"""
54
51
go2parents = {}
@@ -59,7 +56,6 @@ def get_go2parents_isa(go2obj):
59
56
return go2parents
60
57
61
58
62
- # ------------------------------------------------------------------------------------
63
59
def get_go2children_isa (go2obj ):
64
60
"""Get set of immediate children GO IDs"""
65
61
go2children = {}
@@ -70,7 +66,6 @@ def get_go2children_isa(go2obj):
70
66
return go2children
71
67
72
68
73
- # ------------------------------------------------------------------------------------
74
69
def get_go2ancestors (terms , relationships , prt = None ):
75
70
"""Get GO-to- ancestors (all parents)"""
76
71
if not relationships :
@@ -105,7 +100,6 @@ def get_go2descendants(terms, relationships, prt=None):
105
100
return get_id2lowerselect (terms , relationships )
106
101
107
102
108
- # ------------------------------------------------------------------------------------
109
103
def get_go2depth (goobjs , relationships ):
110
104
"""Get depth of each object"""
111
105
if not relationships :
@@ -115,7 +109,6 @@ def get_go2depth(goobjs, relationships):
115
109
return get_go2reldepth (goobjs , relationships )
116
110
117
111
118
- # ------------------------------------------------------------------------------------
119
112
def get_id2parents (objs ):
120
113
"""Get all parent IDs up the hierarchy"""
121
114
id2parents = {}
@@ -177,7 +170,6 @@ def get_relationship_targets(item_ids, relationships, id2rec):
177
170
return reltgt_objs_all
178
171
179
172
180
- # ------------------------------------------------------------------------------------
181
173
# pylint: disable=too-few-public-methods
182
174
class IdToUpperSelect :
183
175
"""Get all ancestor IDs, including all parents and IDs up selected relationships"""
@@ -237,9 +229,6 @@ def _get_id2lowerselect(self, item_id, item_obj):
237
229
return child_ids
238
230
239
231
240
- # ------------------------------------------------------------------------------------
241
-
242
-
243
232
def _get_id2parents (id2parents , item_id , item_obj ):
244
233
"""Add the parent item IDs for one item object and their parents."""
245
234
if item_id in id2parents :
@@ -295,7 +284,6 @@ def _get_id2lower(id2lower, item_id, item_obj, cache: set):
295
284
return lower_ids
296
285
297
286
298
- # ------------------------------------------------------------------------------------
299
287
class CurNHigher :
300
288
"""Fill id2obj with item IDs in relationships."""
301
289
0 commit comments