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.
Starting one
Section titled “Starting one”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
.ipynbfrom 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.
Running cells
Section titled “Running cells”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.
Reading a file without knowing its path
Section titled “Reading a file without knowing its path”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.tiffdata <- relay$open('asset-id') # plate_07.ome.tiffIt 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.
Choosing a runtime
Section titled “Choosing a runtime”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.
Versions and forks
Section titled “Versions and forks”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.
Notebooks and Ray
Section titled “Notebooks and Ray”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.
Notebooks in pipelines and schedules
Section titled “Notebooks in pipelines and schedules”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.