scHopfield.plotting.plot_sigmoid_fit

scHopfield.plotting.plot_sigmoid_fit(adata: AnnData, gene: str, spliced_key: str = 'Ms', color_clusters: bool = False, cluster_key: str = 'cell_type', show_zeros: bool = True, ax: Axes | None = None, **kwargs) Axes[source]

Plot sigmoid fit for a gene showing expression CDF and fitted curve.

Parameters:
  • adata (AnnData) – Annotated data object with fitted sigmoid parameters

  • gene (str) – Gene name to plot

  • spliced_key (str, optional (default: 'Ms')) – Layer key for spliced expression

  • color_clusters (bool, optional (default: False)) – If True, color points by cluster

  • cluster_key (str, optional (default: 'cell_type')) – Key in adata.obs for cluster labels (used if color_clusters=True)

  • show_zeros (bool, optional (default: True)) – If True, show all expression values including zeros. If False, filter out zero values and plot sigmoid without offset.

  • ax (plt.Axes, optional) – Axes to plot on. If None, creates new figure.

  • **kwargs – Additional keyword arguments: - c1: color for expression data (default: ‘gray’) - c2: color for fitted curve (default: ‘red’) - alpha: transparency for scatter points (default: 0.5) - s: size for scatter points (default: 10)

Returns:

Axes with plot

Return type:

plt.Axes

Examples

>>> import scHopfield as sch
>>> sch.pl.plot_sigmoid_fit(adata, 'Gata1')
>>> sch.pl.plot_sigmoid_fit(adata, 'Gata1', color_clusters=True)
>>> sch.pl.plot_sigmoid_fit(adata, 'Gata1', show_zeros=False)  # Hide zeros