deepspatial.vis_utils.interactive_3d_expression#
- deepspatial.vis_utils.interactive_3d_expression(adata: AnnData, gene_name: str, spatial_key: str = 'spatial', z_key: str = 'z_coord', vmin_pct: float = 1.0, vmax_pct: float = 99.0, point_size: float = 2.0, opacity: float = 0.8, colorscale: str = 'Viridis', bg_color: str = 'white', max_points: int = 250000, title: str | None = None, width: int | None = None, height: int | None = None, save_html: str | None = None) Figure[source]#
Generate an interactive Plotly 3D scatter plot for continuous gene expression.
- Parameters:
adata (ad.AnnData) – Annotated data matrix.
gene_name (str) – Feature name present in adata.var_names.
spatial_key (str) – Key in adata.obsm for XY coordinates.
z_key (str) – Key in adata.obs for Z coordinate.
vmin_pct (float) – Lower and upper percentile bounds for clipping expression values.
vmax_pct (float) – Lower and upper percentile bounds for clipping expression values.
point_size (float) – Marker size.
opacity (float) – Marker opacity.
colorscale (str) – Plotly continuous color scale name (e.g., ‘Viridis’, ‘Plasma’).
bg_color (str) – Background color.
max_points (int) – Maximum rendering limit.
title (str, optional) – Plot title. Defaults to feature name.
width (int, optional) – Dimensions of the rendering canvas in pixels.
height (int, optional) – Dimensions of the rendering canvas in pixels.
save_html (str, optional) – Path to save as a standalone interactive HTML file.
- Return type:
plotly.graph_objects.Figure