hv_anndata.ManifoldMap¶
- class hv_anndata.ManifoldMap(**params)¶
Interactive manifold map application for exploring AnnData objects.
This application provides widgets to select dimensionality reduction methods, dimensions for x and y axes, coloring variables, and display options.
- Parameters:
- adata
AnnData object to visualize
- reduction
Initial dimension reduction method to use
- color_by_dim
Color by dimension, one of ‘obs’ (default) or ‘cols.
- color_by
Initial variable to use for coloring
- colormap
Initial colormap. Auto-updates based on data type. Options: - Categorical: “Glasbey Cat10”, “Cat20”, “Glasbey cool” - Continuous: “Viridis”, “Fire”, “Blues” Custom colormaps are not yet supported.
- datashade
Whether to enable datashading
- width
Minimum width of the plot. If responsive is True, this is the minimum width.
- height
Minimum height of the plot. If responsive is True, this is the minimum height.
- show_labels
Whether to show labels
- show_widgets
Whether to show control widgets
- responsive
Whether to make the plot size-responsive
- plot_opts
HoloViews plot options for the manifoldmap plot
- labeller_opts
Operation and plot options for the labeller
Parameter Definitions
adata = ClassSelector(allow_None=True, class_=<class 'anndata.AnnData'>, label='Adata')AnnData object to visualize
reduction = Selector(label='Reduction', names={}, objects=[])Dimension reduction method
x_axis = Selector(label='X axis', names={}, objects=[])y_axis = Selector(label='Y axis', names={}, objects=[])color_by_dim = Selector(default='obs', names={'Observations': 'obs', 'Variables': 'cols'}, objects=['obs', 'cols'])color_by = Selector(label='Color by', names={}, objects=[])Coloring variable
colormap = Selector(allow_None=True, label='Colormap', names={}, objects=['Glasbey Cat10', 'Cat20', 'Glasbey cool', 'Viridis', 'Fire', 'Blues'])Initial colormap name. Auto-selects default if type mismatched
datashade = Boolean(default=True)Whether to enable datashading
var_reference = String(allow_None=True, label='Var reference')Column name in .var to use for populating the variable names, default to the index names if not set.
width = Integer(default=300, inclusive_bounds=(True, True), label='Width')Minimum width of the plot
height = Integer(default=300, inclusive_bounds=(True, True), label='Height')Minimum height of the plot
show_labels = Boolean(default=False)Whether to show labels
show_widgets = Boolean(default=True, label='Show widgets')Whether to show control widgets
ls = ClassSelector(allow_None=True, class_=<class 'holoviews.selection.link_selections'>, label='Ls')streams = List(bounds=(0, None), default=[], label='Streams')List of streams to use for dynamic updates
responsive = Boolean(default=True, label='Responsive')Whether to make the plot size-responsive
plot_opts = Dict(class_=<class 'dict'>, default={}, label='Plot opts')HoloViews plot options for the manifoldmap plot
legend_position = Selector(default='bottom_right', label='Legend position', names={}, objects=['top_left', 'top_center', 'top_right', 'center_left', 'center', 'center_right', 'bottom_left', 'bottom_center', 'bottom_right', 'right', 'left'])Bokeh legend position
legend_alpha = Number(bounds=(0, 1), default=0.6, inclusive_bounds=(True, True), label='Legend alpha', step=0.1)Legend background opacity
legend_font_size = Integer(bounds=(5, 14), default=8, inclusive_bounds=(True, True), label='Legend font size')Legend label font size in pt
legend_ncols = Integer(bounds=(1, 4), default=1, inclusive_bounds=(True, True), label='Legend ncols')Number of legend columns
labeller_opts = Dict(class_=<class 'dict'>, default={}, label='Labeller opts')Operation and plot options for the labeller
_replot = Event(default=False, label=' replot')_categorical = Boolean(default=False, label=' categorical')Attributes
Methods
create_plot(*, dr_key, x_value, y_value, ...)Create a manifold map plot with the specified parameters.
get_dim_labels(dr_key)Get labels for each dimension in a reduction method.
get_reduction_label(dr_key)Get a display label for a dimension reduction key.