Skip to content

Commit

Permalink
Add annotation by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ddomingof committed Oct 10, 2018
1 parent 20e8cf7 commit 3fb5ef3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/pathme/reactome/convert_to_bel.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ def add_edges(graph: BELGraph, participants, nodes, att: Dict):
def add_simple_edge(graph: BELGraph, u, v, edge_types, uri_id):
if 'ACTIVATION' in edge_types:
# TODO anadir pubmed y descripcion
graph.add_increases(u, v, citation=uri_id, evidence='', object_modifier=activity())
graph.add_increases(u, v, citation=uri_id, evidence='', object_modifier=activity(), annotations={})

elif 'INHIBITION' in edge_types:
# TODO anadir pubmed y descripcion
graph.add_decreases(u, v, citation=uri_id, evidence='', object_modifier=activity())
graph.add_decreases(u, v, citation=uri_id, evidence='', object_modifier=activity(), annotations={})

else:
log.warning('edge type %s', edge_types)
10 changes: 5 additions & 5 deletions src/pathme/wikipathways/convert_to_bel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from typing import Dict, List, Tuple

from bio2bel_hgnc import Manager

from pathme.constants import HGNC
from pathme.utils import parse_id_uri, check_multiple
from pathme.wikipathways.utils import evaluate_wikipathways_metadata, get_valid_gene_identifier
Expand Down Expand Up @@ -128,6 +127,7 @@ def complex_to_bel(complex, nodes, graph: BELGraph):

return complex_bel_node


def get_node(node, nodes):
if node not in nodes:
if '/Interaction/' in str(node):
Expand All @@ -139,6 +139,7 @@ def get_node(node, nodes):
else:
return nodes[node]


def add_edges(graph: BELGraph, participants, nodes, att: Dict):
"""Add edges to BELGraph."""
uri_id = att['uri_id']
Expand Down Expand Up @@ -180,13 +181,13 @@ def add_simple_edge(graph: BELGraph, u, v, edge_types, uri_id):
:param uri_id: citation URI
"""
if 'Stimulation' in edge_types:
graph.add_increases(u, v, citation=uri_id, evidence='', object_modifier=activity())
graph.add_increases(u, v, citation=uri_id, evidence='', object_modifier=activity(), annotations={})

elif 'Inhibition' in edge_types:
graph.add_decreases(u, v, citation=uri_id, evidence='', object_modifier=activity())
graph.add_decreases(u, v, citation=uri_id, evidence='', object_modifier=activity(), annotations={})

elif 'Catalysis' in edge_types:
graph.add_increases(u, v, citation=uri_id, evidence='', object_modifier=activity())
graph.add_increases(u, v, citation=uri_id, evidence='', object_modifier=activity(), annotations={})

elif 'TranscriptionTranslation' in edge_types:
graph.add_translation(u, v)
Expand All @@ -199,4 +200,3 @@ def add_simple_edge(graph: BELGraph, u, v, edge_types, uri_id):

else:
log.debug('No handled edge type %s', str(uri_id))

0 comments on commit 3fb5ef3

Please sign in to comment.