py4cytoscape.session.open_session

open_session(file_location=None, base_url='http://127.0.0.1:1234/v1')[source]

Open Session File or URL.

Open a session file or URL. This will clear all networks, tables and styles associated with current session. Be sure to saveSession first.

Note

To load a session file from cloud storage, use the file’s URL and the sandbox_url_to function to download the file to a sandbox, and then use open_session to load it from there.

Parameters
  • file_location (str) – File path or URL (with ‘http’ or ‘https’ prefix). Default is a sample session file.

  • base_url (str) – Ignore unless you need to specify a custom domain, port or version to connect to the CyREST API. Default is http://localhost:1234 and the latest version of the CyREST API supported by this version of py4cytoscape.

Returns

{} empty

Return type

dict

Raises
  • CyError – if filename is invalid

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

Examples

>>> open_session() # load session from sample Yeast Perturbation.cys file
{}
>>> open_session('data/Affinity Purification.cys') # load session from a file
{}
>>> open_session('https://github.com/bdemchak/py4cytoscape/blob/master/tests/data/Affinity%20Purification.cys')
{}

See also

save_session()