Skip to content

Commit

Permalink
Add checker KEGG prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ddomingof committed Jul 8, 2019
1 parent fa06207 commit 564f5c4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pathme/kegg/convert_to_bel.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
from pybel.struct.summary import count_functions, edge_summary

from pathme.constants import *
from pathme.export_utils import add_annotation_key
from pathme.kegg.kegg_xml_parser import (
get_all_reactions, get_all_relationships, get_complex_components, get_entity_nodes, get_reaction_pathway_edges,
import_xml_etree,
)
from pathme.export_utils import add_annotation_key
from pathme.utils import add_bel_metadata

__all__ = [
Expand Down Expand Up @@ -359,6 +359,9 @@ def map_to_bel_node(graph, node):
name = attribute['map_name']
identifier = attribute[KEGG_ID]

if name.startswith('TITLE:'):
name = name.strip('TITLE:')

This comment has been minimized.

Copy link
@cthoyt

cthoyt Jul 8, 2019

Member

That's not going to do what you want (it will interpret that as a regex). Maybe try:

            name = name[len('TITLE:'):]

bio_process = bioprocess(namespace=KEGG.upper(), name=name, identifier=identifier)
graph.add_node_from_data(bio_process)
return bio_process
Expand Down

0 comments on commit 564f5c4

Please sign in to comment.