py4cytoscape.py4cytoscape_utils.node_name_to_node_suid

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

Translate one node name or a list of node names into a list of SUIDs.

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

If a name maps to multiple SUIDs, a list of SUIDs are returned instead of a single SUID.

Parameters
  • node_names (str or list) – an node name or a list of node names

  • 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

[<SUID or SUID list corresponding to each name>]

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_name_to_node_suid('YDR277C')
[1022]
>>> node_name_to_node_suid(['YDR277C', 'YDL194W'], network='myNetwork')
[1022, 1023]
>>> node_name_to_node_suid(['YDR277C', 'AXD206W'], network='myNetwork')
[1022, [1099, 1100]]