scvelo.pp.normalize_per_cell

scvelo.pp.normalize_per_cell(data, counts_per_cell_after=None, counts_per_cell=None, key_n_counts=None, max_proportion_per_cell=None, use_initial_size=True, layers=['spliced', 'unspliced'], enforce=False, copy=False)

Normalize each cell by total counts over all genes.

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

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

counts_per_cell_after : float or None, optional (default: None)

If None, after normalization, each cell has a total count equal to the median of the counts_per_cell before normalization.

counts_per_cell : np.array, optional (default: None)

Precomputed counts per cell.

key_n_counts : str, optional (default: ‘n_counts’)

Name of the field in adata.obs where the total counts per cell are stored.

max_proportion_per_cell : int (default: None)

Exclude genes counts that account for more than a specific proportion of cell size, e.g. 0.05.

use_initial_size : bool (default: True)

Whether to use initial cell sizes oder actual cell sizes.

layers : str or list (default: {‘spliced’, ‘unspliced’})

Keys for layers to be also considered for normalization.

copy : bool, optional (default: False)

If an AnnData is passed, determines whether a copy is returned.

Returns:

Returns or updates adata with normalized version of the original adata.X, depending on copy.