Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
Add equivalentTo exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Nov 13, 2018
1 parent 0213f71 commit a7b7bf4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/biokeen/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

from pybel import BELGraph
from pybel.constants import (
ACTIVITY, DIRECTLY_DECREASES, HAS_COMPONENT, IS_A, MODIFIER, OBJECT, PART_OF, REGULATES, RELATION, TRANSCRIBED_TO,
TRANSLATED_TO,
ACTIVITY, DIRECTLY_DECREASES, EQUIVALENT_TO, HAS_COMPONENT, IS_A, MODIFIER, OBJECT, PART_OF, REGULATES, RELATION,
TRANSCRIBED_TO, TRANSLATED_TO,
)
from pybel.dsl import BaseEntity, MicroRna, Rna

Expand Down Expand Up @@ -101,5 +101,12 @@ def get_triple(graph: BELGraph, u: BaseEntity, v: BaseEntity, key: str) -> Tuple
f'{v.namespace}:{v.identifier or v.name}',
)

elif relation == EQUIVALENT_TO:
return (
f'{u.namespace}:{u.identifier or u.name}',
'equivalent to',
f'{v.namespace}:{v.identifier or v.name}',
)

else:
logger.info(f'unhandled: {graph.edge_to_bel(u, v, data)}')

0 comments on commit a7b7bf4

Please sign in to comment.