py4cytoscape.py4cytoscape_utils.edge_name_to_edge_suid¶
- edge_name_to_edge_suid(edge_names, network=None, base_url='http://127.0.0.1:1234/v1')[source]¶
Translate one edge name or a list of edge 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
edge_names (str or list) – an edge name or a list of edge 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
>>> edge_name_to_edge_suid('YDR277C (pp) YDL194W') [1022] >>> edge_name_to_edge_suid(['YDR277C (pp) YDL194W', 'YDR277C (pp) YDR206W'], network='myNetwork') [1022, 1023] >>> edge_name_to_edge_suid(['YDR277C (pp) YDL194W', 'YDR277C (pp) AXD206W'], network='myNetwork') [1022, [1099, 1100]]