bioalpha.singlecell.tools.aucell

bioalpha.singlecell.tools.aucell(adata: AnnData | H5ADMap, gene_sigs: str | Sequence[GeneSignature] = 'gene_sigs', auc_threshold: float = 0.05, normalize: bool = True, key_added: str = 'aucell', copy: bool | str = False, csr_key: str = 'layers/X_csr', **kwargs) AnnData | H5ADMap | None

Calculate enrichment of gene signatures for single cells.

Parameters:
  • adata (AnnData) – The annotated data matrix of shape n_obs x n_vars. Rows correspond to cells and columns to genes.

  • gene_sigs (Union[str, Sequence[GeneSignature]], default = "gene_sigs") – The gene signatures for calculate scores. If a key(str) is passed, adata.uns[key] will be used as gene signatures.

  • auc_threshold (float, default = 0.05) – The fraction of the ranked genome to take into account for the calculation of the Area Under the recovery Curve.

  • normalize (bool, default = True) – Normalize the AUC values to a maximum of 1.0 per regulon.

  • key_added (Optional[str], default = "aucell") – Name of the field in adata.obsm where the aucell score is stored.

  • copy (bool or str, default = False) – Whether to modify copied input object. If adata is mapping AnnData, copy will be False or Path.

  • csr_key (str, default = "layers/X_csr") – Key for run to_csr() when run on disk.

  • kwargs (dict) – Any additional arguments will be passed to _sctools.enrichment.aucell.

Returns:

adata – If copy=True it returns or else adds fields to adata

  • .obsm[key_added] : AUC scores of each genes sets.

Return type:

AnnData