Skip to content

Dashboard

SCLabDashboard

SCLabDashboard

SCLabDashboard(adata_or_filepath_or_url: AnnData | str | None = None, name: str = 'SCLab Dashboard', counts_layer: str = 'counts', batch_key: str | None = None, copy: bool = False)

Bases: GridBox

Interactive single-cell RNA-seq analysis dashboard for Jupyter notebooks.

Integrates data loading, preprocessing, clustering, visualization, and analysis into a single tabbed widget. Built on top of AnnData/Scanpy with an event-driven architecture for reactive updates between components.

Parameters:

Name Type Description Default
adata_or_filepath_or_url AnnData or str or None

Input data as an AnnData object, a file path (.h5, .h5ad, or 10x MTX folder), or a URL to a remote .h5 or .h5ad file. If None, a data loader widget is displayed instead.

None
name str

Display name for the dashboard. Default is "SCLab Dashboard".

'SCLab Dashboard'
counts_layer str

Name of the layer to use (and create if absent) for raw counts. Default is "counts".

'counts'
batch_key str or None

Key in adata.obs identifying batches/samples for batch-aware steps such as Integration and Neighbors. Default is None.

None
copy bool

If True, work on a copy of the input AnnData. Default is False.

False

Attributes:

Name Type Description
ds SCLabDataset

Shorthand property for the dataset component.

pl Plotter

Shorthand property for the plotter component.

pr Processor

Shorthand property for the processor component.

Examples:

>>> import scanpy as sc
>>> from sclab import SCLabDashboard
>>> adata = sc.datasets.pbmc68k_reduced()
>>> dashboard = SCLabDashboard(adata, name="PBMC Analysis")
>>> display(dashboard)

SCLabDataset

SCLabDataset

SCLabDataset(adata: AnnData, name: str = 'SCLabDataset', counts_layer: str = 'counts', copy: bool = True, broker: EventBroker | None = None)

Bases: EventClient

Wrapper around AnnData with interactive tables and event-driven updates.

Manages observation and variable metadata, row selection, and data representations (obsm entries). Publishes events via the :class:~sclab.event.EventBroker whenever the data or selection changes so that the :class:~sclab.dataset.plotter.Plotter and :class:~sclab.dataset.processor.Processor can react automatically.

Parameters:

Name Type Description Default
adata AnnData

Annotated data matrix to wrap.

required
name str

Display name used in exported table filenames. Default is "SCLabDataset".

'SCLabDataset'
counts_layer str

Name of the raw counts layer. If the layer does not exist it is created from adata.X. Default is "counts".

'counts'
copy bool

If True, work on a copy of adata. Default is True.

True
broker EventBroker or None

Shared event broker. A new one is created if None. Default is None.

None

Attributes:

Name Type Description
adata AnnData

The underlying annotated data matrix.

obs_table GridBox

Interactive ipywidget displaying adata.obs.

var_table GridBox

Interactive ipywidget displaying adata.var.

selected_rows Index

Index of currently selected observations.


Processor

Processor

Processor(dataset: SCLabDataset, plotter: Plotter, *, batch_key: str | None = None)

Bases: EventClient

add_steps

add_steps(_steps: _ProcessorStep | type | list[_ProcessorStep | type] | dict[str, _ProcessorStep | type] | dict[str, list[_ProcessorStep | type]], step_group_name: str = 'Processing')

Add one or more steps to the dataset processor. The steps can be given as a single step instance, a type of step to be instantiated, a list of steps, or a dictionary of step group names to lists of steps.

Parameters:

Name Type Description Default
_steps _ProcessorStep | type | list[_ProcessorStep | type] | dict[str, _ProcessorStep | type] | dict[str, list[_ProcessorStep | type]]

The steps to add to the dataset processor.

required
step_group_name str

The name of the step group to add the steps to. If the step group does not exist, it will be created. Defaults to "Processing".

'Processing'

Raises:

Type Description
ValueError

If the step has already been added to the dataset processor.


Plotter

Plotter

Plotter(dataset: SCLabDataset | None = None, broker: EventBroker | None = None)

Bases: GridBox, EventClient