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 shapen_obsxn_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) – Userawattribute ofadataif present.layer (Optional[
str] , default =None) – Key fromadata.layerswhose value will be used to perform tests on.connectivities_keys (Optional[
str], default ="connectivities") – Key inadata.obspcontaining the connectivities graph.key_added (Optional[
str], default =None) – The key inadata.unsinformation 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 runto_csc()when run on disk.
- Returns:
adata – If
copyisTrue, returns a new AnnData object with binary matrix stored inadata.layersand threshold to cut-off inadata.var. IfFalse, modifies input AnnData in-place.- Return type:
AnnData