scvelo.pp.filter_genes

scvelo.pp.filter_genes(data, min_counts=None, min_cells=None, max_counts=None, max_cells=None, min_counts_u=None, min_cells_u=None, max_counts_u=None, max_cells_u=None, min_shared_counts=None, min_shared_cells=None, copy=False)

Filter genes based on number of cells or counts. Keep genes that have at least min_counts counts or are expressed in at least min_cells cells or have at most max_counts counts or are expressed in at most max_cells cells. Only provide one of the optional parameters min_counts, min_cells, max_counts, max_cells per call.

Parameters:
data : AnnData, np.ndarray, sp.spmatrix

The (annotated) data matrix of shape n_obs × n_vars. Rows correspond to cells and columns to genes.

min_counts : int, optional (default: None)

Minimum number of counts required for a gene to pass filtering.

min_cells : int, optional (default: None)

Minimum number of cells expressed required for a gene to pass filtering.

max_counts : int, optional (default: None)

Maximum number of counts required for a gene to pass filtering.

max_cells : int, optional (default: None)

Maximum number of cells expressed required for a gene to pass filtering.

min_counts_u : int, optional (default: None)

Minimum number of unspliced counts required for a gene to pass filtering.

min_cells_u : int, optional (default: None)

Minimum number of unspliced cells expressed required for a gene to pass filtering.

max_counts_u : int, optional (default: None)

Maximum number of unspliced counts required for a gene to pass filtering.

max_cells_u : int, optional (default: None)

Maximum number of unspliced cells expressed required for a gene to pass filtering.

min_shared_counts : int, optional (default: None)

Minimum number of counts (in cells expressed simultaneously in unspliced and spliced) required for a gene.

min_shared_cells : int, optional (default: None)

Minimum number of cells required for a gene to be expressed simultaneously in unspliced and spliced.

copy : bool, optional (default: False)

Determines whether a copy is returned.

Returns:

Filters the object and adds n_counts to adata.var.