- dynamo.pp.normalize_cells(adata, layers='all', total_szfactor='total_Size_Factor', splicing_total_layers=False, X_total_layers=False, norm_method=None, pseudo_expr=1, relative_expr=True, keep_filtered=True, recalc_sz=False, sz_method='median', scale_to=None, skip_log=False)
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.
str) – the column name in the .obs attribute that corresponds to the size factor for the total mRNA. Defaults to “total_Size_Factor”.
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.
Callable]) – the method used to normalize data. Can be either function np.log1p, np.log2 or any other functions or string clr. By default, only .X will be size normalized and log1p transformed while data in other layers will only be size normalized. Defaults to None.
int) – a pseudocount added to the gene expression value before log/log2 normalization. Defaults to 1.
bool) – whether we need to divide gene expression values first by size factor before normalization. Defaults to True.
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 median is used, locfunc will be replaced with np.nanmedian. Defaults to “median”.
float]) – the final total expression for each cell that will be scaled to. Defaults to None.
bool) – whether skip log transformation. Defaults to False.
- Return type:
An updated anndata object that are updated with normalized expression values for different layers.