py4cytoscape.style_values.get_node_color¶
- get_node_color(node_names=None, network=None, base_url='http://127.0.0.1:1234/v1')[source]¶
Retrieve the actual fill color of specified nodes.
- Parameters
node_names (list) – List of node names or node SUIDs. Default is None for all nodes.
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
as a collection of {node-name: fill-color} for each node in node_names parameter
- Return type
dict
- Raises
CyError – if network name or node doesn’t exist
requests.exceptions.RequestException – if can’t connect to Cytoscape or Cytoscape returns an error
Examples
>>> get_node_color() {'YOR215C': '#FFFFEC', 'YBL026W': '#FCFDFE', 'YOL149W': '#FFFFE3', ...} >>> get_node_color(['YOR215C', 'YBL026W', 'YOL149W']) {'YOR215C': '#FFFFEC', 'YBL026W': '#FCFDFE', 'YOL149W': '#FFFFE3'} >>> get_node_color([395406, 395407, 395404]) {395406: '#FFFFEC', 395407: '#FCFDFE', 395404: '#FFFFE3'} >>> get_node_color(node_names='YOR215C', network='galFiltered.sif') {'YYOR215C': '#FFFFEC'}