py4cytoscape.networks.get_network_suid¶
-
get_network_suid
(title=None, base_url='http://127.0.0.1:1234/v1')[source]¶ Get the SUID of a network.
- Parameters
suid (SUID or str or None) – Name of the network; default is “current” network. If an SUID is provided, then it is validated and returned.
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
network SUID
- Return type
int
- Raises
ValueError – if server response has no JSON
CyError – if network name or SUID doesn’t exist
requests.exceptions.RequestException – if can’t connect to Cytoscape or Cytoscape returns an error
Examples
>>> get_network_suid() # get SUID of current network 22752 >>> get_network_suid('galFiltered.sif') # get SUID of network having name 22752 >>> get_network_suid(22752) # verify that current network has SUID 22752 22752
Notes
Together with getNetworkSuid, this function attempts to handle all of the multiple ways we support network referencing (e.g., title, SUID, ‘current’, and NULL). These functions are then used by all other functions that take a “network” argument.