stonpy.conversion module

The module for converting SBGN maps to a subgraphs and vice-versa.

stonpy.conversion.map_to_subgraph(sbgn_map, map_id=None, make_shortcuts=True, make_sbml_annotations=True, verbose=False)[source]

Convert an SBGN map to a subgraph and return it.

Parameters:
  • sbgn_map (libsbgnpy.libsbgn.map) – the SBGN map

  • map_id (str, optional) – the ID of the SBGN map, default is None

  • make_shortcuts (bool, optional) – if set to True, shortcut relationships will be added. Defaults to True.

  • make_sbml_annotations (bool, optional) – if set to True, SBML annotations inside extensions will be added as nodes and relationships. Defaults to True.

  • verbose (bool, optional) – if set to True, prints operations to stdout. Defaults to True.

Returns:

the resulting subgraph

Return type:

py2neo.Subgraph

stonpy.conversion.subgraph_to_map(subgraph)[source]

Convert a subgraph to zero or more SBGN maps and return them.

Parameters:

subgraph (py2neo.Subgraph) – the subgraph

Returns:

the resulting SBGN maps, under the form of a generator. Each returned element is a tuple of the form (map, map_id).

Return type:

Iterator[(`libsbgnpy.libsbgn.map, str)]`