highest_expressed_genes#

highest_expressed_genes(data: AnnData, n: int = 20, *, mapping: FeatureSpec | None = None, threshold: float | None = None, observations_name: str = 'Barcode', value_column: str = 'value', variable_column: str = 'variable', color: str = '#1f1f1f', size=0.5, outlier_size: float = 0.2, outlier_alpha: float = 0.5, fatten: float = 1, **geom_kwargs) PlotSpec#

Highest Expressed Genes Plot.

Parameters:
  • data (AnnData) – The AnnData object of the single cell data.

  • n (int, default 20) – Number of top expressed genes to display, ranked by mean percentage across all cells.

  • mapping (FeatureSpec | None, default None) – Additional aesthetic mappings for the plot, the result of aes().

  • threshold (float | None, default None) – If provided, filters out rows where the value column is below the threshold.

  • observations_name (str, default 'Barcode') – The name to give to barcode (or index) column in the dataframe.

  • value_column (str, default 'value') – The name to give to the value column after unpivoting.

  • variable_column (str, default 'variable') – The name to give to the variable column after unpivoting.

  • color (str, default '#1f1f1f') – Border color of the boxplots.

  • size (float, default 0.5) – Line size of the boxplots.

  • outlier_size (float, default 0.2) – Size of the outlier points.

  • outlier_alpha (float, default 0.5) – Transparency of the outlier points.

  • fatten (float, default 1) – Factor to fatten the median line.

  • **geom_kwargs – Additional parameters for the geom_boxplot layer. For more information on geom_boxplot parameters, see: https://lets-plot.org/python/pages/api/lets_plot.geom_boxplot.html

Returns:

PlotSpec – Highest expressed genes boxplot.

Examples

A simple Highest expressed genes boxplot.

import scanpy as sc
from lets_plot import *

import cellestial as cl

data = sc.read_h5ad("data/pbmc3k_pped.h5ad")

cl.highest_expressed_genes(data,n=20)

Customize the plot.

import scanpy as sc
from lets_plot import *

import cellestial as cl

data = sc.read_h5ad("data/pbmc3k_pped.h5ad")

cl.highest_expressed_genes(
    data,
    n=10,
    outlier_size=0.1,
    outlier_alpha=0.2,
    outlier_shape=5)+scale_fill_viridis()