py4cytoscape.style_values.get_node_property

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

Get values for any node property of the specified nodes.

Parameters
  • node_names (list) – List of node names or node SUIDs. Default is None for all nodes.

  • visual_property (str) – Name of a visual property. See get_visual_property_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

as a collection of {node-name: prop_value} for each node in node_names parameter

Return type

dict

Raises
  • CyError – if network name, node name or property name doesn’t exist

  • requests.exceptions.RequestException – if can’t connect to Cytoscape or Cytoscape returns an error

Examples

>>> get_node_property(visual_property='NODE_LABEL')
{'YIL070C': 'MAM33', 'YHR198C': 'YHR198C', ...}
>>> get_node_property(visual_property='NODE_LABEL', node_names=['YIL070C', 'YHR198C'])
{'YIL070C': 'MAM33', 'YHR198C': 'YHR198C'}
>>> get_node_property(visual_property='NODE_LABEL', node_names=[391173, 391172, 391175])
{391173: 'RPL11B', 391172: 'SXM1', 391175: 'MPT1'}
>>> get_node_property(visual_property='NODE_LABEL', node_names='YER112W', network='galFiltered.sif')
{'YER112W': 'LSM4'}