scviva.tools.harreman.tools.apply_gene_filtering#
- scviva.tools.harreman.tools.apply_gene_filtering(adata, layer_key=None, cell_type_key=None, model=None, feature_elimination=False, threshold=0.2, autocorrelation_filt=False, expression_filt=False, de_filt=False, umi_counts_obs_key=None, device='auto', verbose=False)[source]#
Applies multi-step gene filtering to an AnnData object.
- Parameters:
- adata
AnnData Annotated data object (AnnData).
- layer_key
Union[Literal['use_raw'],str,None] Key to use from
adata.layersor"use_raw"to useadata.raw.X.- cell_type_key
str|None Key in
adata.obscontaining cell type annotations.- model
str|None Model name for autocorrelation computation.
- feature_elimination
bool|None If True, filters genes based on sparsity across all cells.
- threshold
float|None Minimum fraction of cells in which the gene must be expressed.
- autocorrelation_filt
bool|None If True, filters genes based on spatial autocorrelation significance.
- expression_filt
bool|None If True, filters genes based on expression in each cell type.
- de_filt
bool|None If True, filters genes based on differential expression between each cell type and the rest.
- umi_counts_obs_key
str|None Key in
adata.obswith total UMI counts per cell. IfNone, inferred from the expression matrix.- device
device|str Device to use for computation (e.g., CUDA or CPU). Defaults to GPU if available.
- verbose
bool|None Whether to print progress and status messages.
- adata
- Return type:
- Returns:
None