Skip to content

Notebooks

Notebooks are ordinary .ipynb files. Anything you write here opens in Jupyter or VS Code, and anything you already have imports without conversion. What Relay adds is the machine behind the notebook, the files around it, and Ray.

The Notebooks app opens on three buttons and a list of Your notebooks:

  • New notebook — pick a Language, Python (scanpy, anndata, scikit-learn preinstalled) or R (Seurat, SingleCellExperiment), and an empty notebook is created in your Drive.
  • From template — a working notebook you edit rather than start from nothing.
  • Upload — an .ipynb from this machine.

Every notebook is saved to Notebooks/ in your Drive as you work, so it is findable in the Data app next to the data it reads.

Shift+Enter runs a cell. The Kernel tab in the Inspector has Run all, an interrupt button, Add cell, Fork (a copy with outputs cleared) and Versions.

A cell’s ⋮ menu has Insert reference, Mark as inputs cell, Switch to Markdown / Switch to Code, and Delete cell.

You should never have to type a path. Either:

  • drag a file from the Data app onto a cell, or
  • choose Insert reference from the cell’s ⋮ menu and pick a file.

Relay inserts the line that opens it:

data = relay.open('asset-id') # plate_07.ome.tiff
data <- relay$open('asset-id') # plate_07.ome.tiff

It works the same whether the file is on your disk, in your Drive, in a connected bucket, or a Commons asset: the file is fetched to the kernel and relay.open gives you something you can hand straight to your usual library.

The Runtime control in the Kernel tab is the whole cloud-compute story. Stay on CPU, or switch to a T4, A10G or A100 GPU and the notebook reconnects to that machine. Nothing to install or provision.

Every save is a version. Versions lists them; Restore this version rolls back, and the version you were on is kept. Fork makes a separate copy with outputs cleared, for trying something without touching the original.

Select one or more cells and ask Ray about them — the placeholder changes to Ask Ray about 3 cells…. Ray can explain a cell, fix an error, or write the next one. It can also create and run a whole notebook from a question in the chat bar: write a notebook that loads this h5ad and plots a UMAP coloured by sample.

Save as pipeline node publishes a notebook as a step other pipelines can use. Mark the cell that reads inputs with Mark as inputs cell so the pipeline knows where to feed the file in. A notebook can also run on a schedule on its own; see Automation.