Sandbox

Functions for performing file operations within a sandbox.

A sandbox is a directory on the Cytoscape workstation that is guaranteed writeable and is guaranteed to be isolated from the whole file system. All file operations are carried out relative to the “current sandbox”. Generally, a Notebook-based workflow doesn’t have to do anything to set up a sandbox … the default sandbox is automatically set up as part of py4cytoscape startup. However, the workflow can set different sandboxes, and can even switch between them. A sandbox can contain both files and directories, and the user can transfer files between a sandbox and the workflow’s native file system (e.g., a remote Notebook’s server).

If a sandbox is defined, all Cytoscape functions read and write files to it by default.

Thus, is it possible to build workflows that don’t depend on the structure of the Cytoscape workstation’s file system. Such workflows can store workflow data files along with other workflow files on a remote Notebook server, then transfer them to a sandbox only when Cytoscape will need them. Conversely, when Cytoscape creates a file in a sandbox (e.g., exporting an image), the workflow can transfer the file to workflow storage.

A special case is when py4cytoscape is running on the same workstation as Cytoscape. The default sandbox is considered to be directory that’s current for the Python kernel. Alternatively, the workflow could also define a sandbox, and then move files in and out of it just as a remote Notebook would.

See Also:

Sandboxing in the Concepts section in the py4cytoscape User Manual.

Sandbox

sandbox_set(sandbox_name[, copy_samples, …])

Set a new default sandbox, creating it if necessary.

sandbox_remove([sandbox_name, base_url])

Delete sandbox contents and remove its directory.

sandbox_get_file_info(file_name[, …])

Get metadata on file in sandbox (or entire sandbox).

sandbox_send_to(source_file[, dest_file, …])

Transfer a file to a sandbox.

sandbox_url_to(source_url, dest_file[, …])

Transfer a cloud-based file to a sandbox.

sandbox_get_from(source_file[, dest_file, …])

Transfer a file from a sandbox.

sandbox_remove_file(file_name[, …])

Remove a file from a sandbox.