dtangle#

Attributes#

Functions#

deconvolut(Y, references, reference_annotation_col[, ...])

Estimate cell type mixing proportions using a dtangle-style estimator.

Package Contents#

dtangle.__version__: str#
dtangle.deconvolut(Y, references, reference_annotation_col, n_markers=None, data_type=None, gamma=None, markers=None, marker_method='ratio', summary_fn=np.mean, *, layer=None, var_key=None, key_added='dtangle', copy=False)#

Estimate cell type mixing proportions using a dtangle-style estimator.

Parameters:
  • Y (anndata.AnnData) – Mixture expression AnnData with shape (samples, genes).

  • references (anndata.AnnData) – Reference expression AnnData where each row is a pure sample.

  • reference_annotation_col (str) – AnnData .obs column in references containing cell type annotations used to group pure samples.

  • n_markers (int | float | collections.abc.Sequence[int | float] | None) – Marker count control. Supports scalar integer, per-type integer vector, scalar fraction in (0,1), or per-type fraction vector.

  • data_type (str | None) – Optional data type key used to choose built-in gamma.

  • gamma (float | None) – Optional explicit gamma overriding data_type.

  • markers (collections.abc.Mapping[str, collections.abc.Sequence[int | str]] | collections.abc.Sequence[collections.abc.Sequence[int | str]] | None) – Optional marker indices per cell type. If omitted, markers are computed internally using marker_method.

  • marker_method (str) – Marker ranking method: ratio, regression, diff, p.value.

  • summary_fn (collections.abc.Callable[[numpy.ndarray], float]) – Summary function used by baseline and per-sample aggregation.

  • layer (str | None) – Optional AnnData layer key to use instead of X.

  • var_key (str | None) – Optional adata.var key used for feature alignment and marker names.

  • key_added (str) – Output key for AnnData mode.

  • copy (bool) – Return modified AnnData in AnnData mode.

Returns:

None (in-place) or AnnData if copy=True. Results are written to adata.obsm[key_added] and adata.uns[key_added].

Return type:

anndata.AnnData | None