Example: A DESeq2 workflow execution outputs a Plots Artifact on Latch Data with all the notebook parameters filled out. This eliminates the need for manual parameter entry by scientists, thereby minimizing rooms for errors.
Behavior
- Using the API in workflow code creates a Plot Artifact in Latch Data. We provide a detailed usage example below.
- Double-clicking the Artifact opens a new Plot Notebook based on the template defined in the workflow code.
- Each Plot Notebook runs on a dedicated machine:
- The machine is started the first time the Artifact is opened.
- Subsequent openings of the Artifact reuse the same machine to avoid extra costs.
Usage
Step 1: Define the PlotsArtifact
dataclass:
Example
How to fill out the `PlotsArtifactTemplate`
How to fill out the `PlotsArtifactTemplate`
To fill out the





PlotsArtifactTemplate
dataclass, we need to define four things:- The plot template ID
- The ID of the Python transform cell that contains the widget
- The unique ID of the widget (as one Python transform cell may contain many widgets)
- The value we want to populate the widget with
How to find:
Plot Template ID
Plot Template ID
- Navigate to https://console.latch.bio/plots
- Click on the + Layout icon.

- Click on the screwdriver icon to access the Template’s settings.

- See the Plot Template’s ID circled in the screenshot below. The template ID is the number to the right.

Transform Cell ID
Transform Cell ID
- Create a new notebook from the template
- Make sure you turn on Dev Mode for the notebook.

- Navigate to the cell of interest.
- Copy the ID underneath the cell.

Widget Key
Widget Key
When creating the Plot notebook’s template, provide the widget with key like so:Example: Let’s say a Python transform cell has three widgets:
Inside a code cell of a Plot Template
Pro-tip: Not all the widgets in your original template have explicitly defined keys. If not, the key value is the order of the widget in that cell.
- widget 1: (no key) => Key value is “0”
- widget 2: (key = “k”) => Key value is “k”
- widget 3: (no key) => Key value is “1”