yomix.plotting.features

This module provides tools for visualizing features in various formats such as scatter plots, violin plots, heatmaps, and more. It includes functionality for customizing plot colors and resizing, as well as managing data visualization features.

Functions

color_by_feature_value(points_bokeh_plot, violins_bokeh_plot, heat_map, adata, select_color_by, hidden_text_label_column, resize_width_input, hidden_legend_width, hidden_checkbox_A, hidden_checkbox_B, resize_w_input, resize_h_input)

This function allows the user to color data points on a scatter plot (Bokeh plot) based on the value of a feature from the input data (adata). It provides interactivity for selecting features, which are then used to modify the color of the scatter plot points.

Parameters:
  • points_bokeh_plot (Bokeh.plotting.figure.Figure) – The Bokeh scatter plot object that displays the points.

  • violins_bokeh_plot (Bokeh.plotting.figure.Figure) – The Bokeh violin plot object for visualizing distributions.

  • heat_map (Bokeh.plotting.figure.Figure) – The heatmap object that displays a heatmap of feature values.

  • adata (AnnData) – The AnnData object containing the single-cell data, which includes the features to color by.

  • select_color_by (str) – A dropdown or text input widget for selecting the feature to color by.

  • hidden_text_label_column (str) – The column to use for labeling the points with text labels.

  • resize_width_input (int) – The input width for resizing the plot’s elements.

  • hidden_legend_width (int) – The width of the legend in the visualization.

  • hidden_checkbox_A (Bokeh.models.widgets.CheckboxGroup) – A hidden checkbox controlling specific plot options or features.

  • hidden_checkbox_B (Bokeh.models.widgets.CheckboxGroup) – Another hidden checkbox for additional plot control.

  • resize_w_input (int) – Width of the resized plot.

  • resize_h_input (int) – Height of the resized plot.

Returns:

Allows the user to input a feature name to color the scatter plot. Allows the user to input labels or groups, affecting how data is visualized in the violin and heatmap plots.

Return type:

tuple of textinput

plot_var(adata, points_bokeh_plot, violins_bokeh_plot, heat_map, resize_w, resize_h, hidden_checkbox_A, hidden_checkbox_B, features, selected_labels=None, equal_size=False)

This function generates a violin plot and heatmap for the feature values across different subsets of data. It computes kernel density estimates (KDEs) for the data and visualizes distributions for different labels in the dataset.

Parameters:
  • adata (AnnData) – The AnnData object containing the data to be visualized.

  • points_bokeh_plot (Bokeh.plotting.figure.Figure) – The Bokeh scatter plot for displaying the data points.

  • violins_bokeh_plot (Bokeh.plotting.figure.Figure) – The Bokeh violin plot for visualizing feature distributions.

  • heat_map (Bokeh.plotting.figure.Figure) – The heatmap showing feature values for cells or conditions.

  • resize_w (int) – The width for resizing the plot.

  • resize_h (int) – The height for resizing the plot.

  • hidden_checkbox_A (Bokeh.models.widgets.CheckboxGroup) – A hidden checkbox for controlling plot-specific options.

  • hidden_checkbox_B (Bokeh.models.widgets.CheckboxGroup) – A hidden checkbox for controlling additional options.

  • features (list) – The list of features (columns from the AnnData object) to be plotted.

  • selected_labels (list, optional) – The labels to be selected for plotting, optional.

  • equal_size (bool, optional) – Whether to enforce equal sizing for the plots, optional.

Returns:

he function modifies the violins_bokeh_plot and heat_map objects in place, but it does not return any value.

Return type:

None