scHopfield.preprocessing.fit_all_sigmoids

scHopfield.preprocessing.fit_all_sigmoids(adata: AnnData, genes: None | List[str] | List[bool] | List[int] = None, spliced_key: str = 'Ms', min_th: float = 0.05, copy: bool = False) AnnData | None[source]

Fit sigmoid functions to gene expression data.

Fits sigmoid parameters (threshold, exponent, offset) for each gene to model the cumulative distribution of expression values.

Parameters:
  • adata (AnnData) – Annotated data object

  • genes (None, list of str, list of int, or array of bool, optional) – Gene subset to use. If None, uses all genes.

  • spliced_key (str, optional (default: 'Ms')) – Key in adata.layers for spliced counts

  • min_th (float, optional (default: 0.05)) – Minimum threshold as fraction of max expression

  • copy (bool, optional (default: False)) – If True, return a copy instead of modifying in-place

Returns:

Returns adata if copy=True, otherwise None. Adds to adata.var: - ‘sigmoid_threshold’: threshold parameter k - ‘sigmoid_exponent’: exponent parameter n - ‘sigmoid_offset’: offset parameter - ‘sigmoid_mse’: mean squared error of fit

Return type:

AnnData or None

Notes

Stores gene indices used in adata.var[‘scHopfield_used’]