py4cytoscape.style_auto_mappings.gen_node_shape_map

gen_node_shape_map(table_column, default_shape=None, style_name=None, network=None, base_url='http://127.0.0.1:1234/v1')[source]

Generate shape map parameters for discrete values in a node table

Parameters
  • table_column (str) – Name of Cytoscape node table column to map values from

  • default_shape (str) – shape name to set as default for all unmapped values

  • style_name (str) – name for style

  • network (SUID or str or None) – Name or SUID of a network or view. 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

Collection of parameter values suitable for passing to a shape style_mappings setter function

Return type

dict

Raises
  • CyError – if network doesn’t exist or if the number of discrete values exceed the number of available shapes

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

Examples

>>> gen_node_shape_map('newcol', style_name='galFiltered Style')
{'table_column': 'newcol', 'table_column_values': ['8', '7', '1'], 'shapes': ['VEE', 'OCTAGON', 'HEXAGON'], 'default_shape': None, 'style_name': 'galFiltered Style', 'network': None, 'base_url': 'http://127.0.0.1:1234/v1'})

See also

set_node_shape_mapping()

See also

Value Generators in the Concepts section in the py4cytoscape User Manual.