Latch Plots’ Notebook view offers a familiar interface like Jupyter, where you can use Python and popular libraries such as pandas or scikit-learn to explore your data.

Latch Plots enriches the traditional notebook experience in two significant ways:

  1. No-Code, Interactive Plot/Visualization Cells: These cells allow you to create visualizations without writing code.
  2. User-Friendly Input Widgets: These widgets can be exposed to scientists, making the analysis more accessible.

In the next section, we will walk through how you can develop your first notebook, and rapidly turn it into a powerful visualization application.

Start a New Notebook

In the right sidebar click the + New Plot Layout button.

This will open up a creation modal where you can give your layout a name, select start from a Blank Layout and then click create.

Bring in Data

There are two ways you can bring in data:

Build Notebook Logic by Adding Cells

Latch Plots provides a wide variety of code and no-code cell types to help you create an interactive data analysis experience.

By interspersing Custom Data Analysis cells with user-friendly widgets, powered by Python code, and adding informative Text and Plot cells, you can enable scientists to further explore and personalize their data visualizations, creating an engaging and interactive plotting experience.

Create Your First Custom Data Analysis Cell and Exposing User-friendly Widgets to scientists

  1. Click the + Custom Data Analysis to add a Python cell.
from lplots.widgets.ldata import w_ldata_picker
import pandas as pd

# Select a CSV file using the widget
csv = w_ldata_picker(label="Condition CSV")

# `.value` is used to retrieve user-inputted value
# If the user has not selected a file yet, exit the code
if csv.value is None:
	exit(0)

# If the user has selected a file, read the selected file into a Pandas DataFrame
df = pd.read_csv(csv.value.download())
  1. Once you click Run, a data selector widget with a Select File button will show up.

To follow along, you upload an example output file from a differential gene expression analysis workflow CoCl2 vs control (condition).csv, and select it in the file modal.

  1. Next, let’s add a selector widget to enable scientists to select their genes of interest, and filter the original data frame to only contain these genes.

Add the following code to your current Python cell:

from lplots.widgets.multiselect import w_multi_select

options = df["Unnamed: 0"].unique()

genes = w_multi_select(
  label="Genes of interest",
  options=options
)

# Check if the user has selected any options. Stop running the cell here if no options have been selected. 
if genes.value is None:
  exit(0)

filtered_df = df[df["Unnamed: 0"].isin(genes.value)]
  1. Rename your cell to something descriptive, like “Choose Genes of Interest.” This name will be helpful when you need to select the cell and choose which of its outputs to plot in the next step.
  1. All global Pandas DataFrames referenced in the code are displayed underneath the Custom Data Analysis cells by default.

Plot the Output of the Custom Data Analysis Cell

  1. Click + Plot to create a new Plot cell.
  2. For Data Source, select the upstream Custom Data Analysis cell labeled Choose Genes of Interest. Click filtered_df as the table you want to plot.
  3. In the Plot’s settings, you can select the plot types, X-axis, Y-axis, and more. Visit the Plots Overview page to learn about customizing plot appearances and advanced interactive features, such as visually editing a plot with table filters or displaying underlying data points with lasso select.

Turn Your Notebook into a No-code Plot Template

To hide the ability to edit code from end users, you can simply click Disable Dev Mode.

To turn the notebook into a template that can be reused by multiple scientists for future experiments, click on the three dots next to your notebook’s name, and select Save as a Template. Provide your template with a name and version.

That’s it! You’ve published the first interactive Plot Template to your workspace. 🎉

The next time a scientist needs to use the application for a new dataset, they can select + Plot Layout and choose a Plot Template you’ve published for them.