py4cytoscape.style_values.get_edge_property

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

Get values for any edge property of the specified edges.

This method retrieves the actual property of the node, given the current visual style, factoring together any default, mapping and bypass setting.

Parameters
  • edge_names (str or list or int or None) – List of edges or None. If node list: list of edge names or SUIDs, comma-separated string of edge names or SUIDs, or scalar edge name or SUID. Edge names should be found in the name column of the edge table. If list is None, default is all edges.

  • 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 {edge-name: prop_value} for each edge in edge_names parameter

Return type

dict

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

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

Examples

>>> get_edge_property(visual_property='EDGE_LABEL')
{'YJR022W (pp) YNL050C': 'pp', 'YKR026C (pp) YGL122C': 'pp', ...}
>>> get_edge_property(visual_property='EDGE_LABEL', edge_names=['YCL067C (pd) YIL015W', 'YCR084C (pp) YCL067C'])
{'YCL067C (pd) YIL015W': 'pd', 'YCR084C (pp) YCL067C': 'pp'}
>>> get_edge_property(visual_property='EDGE_LABEL', edge_names='YCL067C (pd) YIL015W, YCR084C (pp) YCL067C')
{'YCL067C (pd) YIL015W': 'pd', 'YCR084C (pp) YCL067C': 'pp'}
>>> get_edge_property(visual_property='EDGE_LABEL', edge_names=[393222, 393223])
{393222: 'pd', 393223: 'pp'}
>>> get_edge_property(visual_property='EDGE_LABEL', edge_names='393222, 393223')
{393222: 'pd', 393223: 'pp'}
>>> get_edge_property(visual_property='EDGE_LABEL', edge_names=393222)
{393222: 'pd'}
>>> get_edge_property(visual_property='EDGE_LABEL', edge_names='YDR277C (pp) YJR022W', network='galFiltered.sif')
{'YDR277C (pp) YJR022W': 'pp'}

Note

To identify a node whose name contains a comma, use ‘\’ to escape the comma. For example, ‘node1 (pd) node\,2’ identifies ‘node1 (pd) node,2’.