bioalpha.singlecell.experimental.tools.thresholding

bioalpha.singlecell.experimental.tools.thresholding(adata: AnnData | H5ADMap, *, groupby: str, use_raw: bool | None = None, layer: str | None = None, connectivities_keys: str | None = 'connectivities', key_added: str | None = None, copy: bool | str = False, max_thresholding: int = 1, csc_key: str = 'layers/X_csc')

Find threshold to cut-off and smooth the expression matrix.

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

  • groupby (str) – The key of the observations grouping to consider.

  • use_raw (Optional[bool], defautl = None) – Use raw attribute of adata if present.

  • layer (Optional[str] , default = None) – Key from adata.layers whose value will be used to perform tests on.

  • connectivities_keys (Optional[str], default = "connectivities") – Key in adata.obsp containing the connectivities graph.

  • key_added (Optional[str], default = None) – The key in adata.uns information is saved to.

  • copy (bool, default = False) – Determines whether a copy is returned.

  • max_thresholding (int, default = 1) – The maximum fraction of expressed cells that is allowed to cut off.

  • csc_key (str, default = "layers/X_csc") – Key for run to_csc() when run on disk.

Returns:

adata – If copy is True, returns a new AnnData object with binary matrix stored in adata.layers and threshold to cut-off in adata.var. If False, modifies input AnnData in-place.

Return type:

AnnData