Skip to content

Commit

Permalink
Merge branch 'pr281'
Browse files Browse the repository at this point in the history
  • Loading branch information
deeenes committed Feb 16, 2024
2 parents fbff6cd + d07439a commit 2e0bfed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pypath/inputs/cellphonedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ def get_type(entity):
'unknown'
)

def get_bool(rec, attr):

return attr in rec and rec[attr].upper() == 'TRUE'

CellphonedbInteraction = collections.namedtuple(
'CellphonedbInteraction',
[
Expand All @@ -274,6 +278,7 @@ def get_type(entity):
'interaction_type',
'type_a',
'type_b',
'is_ppi',
]
)

Expand Down Expand Up @@ -304,6 +309,7 @@ def get_type(entity):
rec['partner_b'],
complexes = complexes,
)
_is_ppi = get_bool(rec, 'is_ppi')

for partner_a, partner_b in itertools.product(_partner_a, _partner_b):

Expand Down Expand Up @@ -338,6 +344,7 @@ def get_type(entity):
interaction_type = '%s-%s' % (_type_a, _type_b),
type_a = _type_a,
type_b = _type_b,
is_ppi = _is_ppi,
)
)

Expand Down
1 change: 1 addition & 0 deletions pypath/resources/data_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -2945,6 +2945,7 @@ def _pathwaycommons_single_resource(resource, transcription = False):
header = False,
extra_edge_attrs = {
'type': 4,
'is_ppi': 7,
},
extra_node_attrs_a = {
'cellphonedb_type': 5,
Expand Down

0 comments on commit 2e0bfed

Please sign in to comment.