Skip to content

Commit

Permalink
Add annotation automatically to KEGG BEL files
Browse files Browse the repository at this point in the history
  • Loading branch information
ddomingof committed Jul 5, 2019
1 parent 71404e2 commit 97cb0cc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pathme/kegg/convert_to_bel.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from pybel.dsl.edges import activity
from pybel.dsl.node_classes import CentralDogma
from pybel.dsl.nodes import bioprocess, composite_abundance, pmod, reaction
from pybel.struct import add_annotation_value
from pybel.struct.summary import count_functions, edge_summary

from pathme.constants import *
Expand Down Expand Up @@ -78,6 +79,9 @@ def kegg_to_bel(path, hgnc_manager, chebi_manager, flatten=False):
add_edges(graph, relations_list, nodes)
add_reaction_edges(graph, reactions_dict, nodes)

graph.annotation_pattern['PathwayID'] = '.*'
add_annotation_value(graph, 'PathwayID', f'{root.attrib["org"]}{root.attrib["number"]}')

return graph


Expand Down

0 comments on commit 97cb0cc

Please sign in to comment.