py4cytoscape.py4cytoscape_utils.edge_suid_to_edge_name

edge_suid_to_edge_name(edge_suids, network=None, base_url='http://127.0.0.1:1234/v1')[source]

Translate one edge SUID or a list of edge SUIDs into a list of names.

List can contain a mixture of names and SUIDs. If it does, only the SUIDs are translated, but all entries are returned. If the list contains all names and no SUIDs, the list is returned.

Parameters
  • edge_suids (SUID or list) – an edge SUID or a list of edge SUIDs

  • network (SUID or str or None) – Name or SUID of a network. Default is the “current” network active in Cytoscape.

  • base_url (str) – Ignore unless you need to specify a custom domain, port or version to connect to the CyREST API. Default is http://127.0.0.1:1234 and the latest version of the CyREST API supported by this version of py4cytoscape.

Returns

[<name corresponding to each SUID>] or None if edge_suids is None

Return type

list

Raises
  • CyError – if network name or SUID doesn’t exist

  • requests.exceptions.RequestException – if can’t connect to Cytoscape or Cytoscape returns an error

Examples

>>> edge_suid_to_edge_name(1022)
['YDR277C (pp) YDL194W']
>>> edge_suid_to_edge_name('1022, 1023')
['YDR277C (pp) YDL194W', 'YDR277C (pp) YDR206W']
>>> edge_suid_to_edge_name([1022, 1023], network='myNetwork')
['YDR277C (pp) YDL194W', 'YDR277C (pp) YDR206W']
>>> edge_suid_to_edge_name(['YDR277C (pp) YDL194W', 'YDR277C (pp) YDR206W'], network='myNetwork')
['YDR277C (pp) YDL194W', 'YDR277C (pp) YDR206W']