- dynamo.pp.normalize(adata, layers='all', total_szfactor=None, splicing_total_layers=False, X_total_layers=False, keep_filtered=True, recalc_sz=False, sz_method='median', scale_to=None)
Normalize the gene expression value for the AnnData object.
This function is partly based on Monocle R package (https://github.com/cole-trapnell-lab/monocle3).
AnnData) – an AnnData object.
str) – the layer(s) to be normalized. Default is all, including RNA (X, raw) or spliced, unspliced, protein, etc.
bool) – whether to also normalize spliced / unspliced layers by size factor from total RNA. Defaults to False.
bool) – whether to also normalize adata.X by size factor from total RNA. Defaults to False.
bool) – whether we will only store feature genes in the adata object. If it is False, size factor will be recalculated only for the selected feature genes. Defaults to True.
bool) – whether we need to recalculate size factor based on selected genes before normalization. Defaults to False.
'median']) – the method used to calculate the expected total reads / UMI used in size factor calculation. Only mean-geometric-mean-total / geometric and median are supported. When mean-geometric-mean-total is used, size factors will be calculated using the geometric mean with given mean function. When median is used, locfunc will be replaced with np.nanmedian. When mean is used, locfunc will be replaced with np.nanmean. Defaults to “median”.
- Return type:
An updated anndata object that are updated with normalized expression values for different layers.