py4cytoscape.py4cytoscape_utils.node_suid_to_node_name

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

Translate one node SUID or a list of node 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
  • node_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 node_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

>>> node_suid_to_node_name(1022)
['YDR277C']
>>> node_suid_to_node_name([1022, 1023], network='myNetwork')
['YDR277C', 'YDL194W']
>>> node_suid_to_node_name(['YDR277C', 'YDL194W'], network='myNetwork')
['YDR277C', 'YDL194W']
>>> node_suid_to_node_name('YDR277C, YDL194W', network='myNetwork')
['YDR277C', 'YDL194W']