py4cytoscape.network_views.create_view

create_view(layout=True, network=None, base_url='http://127.0.0.1:1234/v1')[source]

Create a network view if one does not already exist

Parameters
  • layout (bool) – If True, the preferred layout will be applied to the new view; otherwise, no layout will be applied.

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

SUID of the view for the network

Return type

int

Raises
  • CyError – if network doesn’t exist

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

Examples

>>> create_view()
130223
>>> create_view(False)
130223
>>> create_view(network='galFiltered.sif')
130223