rapids_singlecell.pp.normalize_total#
- rapids_singlecell.pp.normalize_total(adata, *, target_sum=None, exclude_highly_expressed=False, max_fraction=0.05, layer=None, inplace=True, copy=False)[source]#
Normalizes rows in matrix so they sum to
target_sum.- Parameters:
- adata
AnnData AnnData object
- target_sum
float|None(default:None) If
None, after normalization, each observation (cell) has a total count equal to the median of total counts for observations (cells) before normalization.- exclude_highly_expressed
bool(default:False) Exclude (very) highly expressed genes for the computation of the normalization factor (size factor) for each cell. A gene is considered highly expressed, if it has more than
max_fractionof the total counts in at least one cell. The not-excluded genes will sum up totarget_sum.- max_fraction
float(default:0.05) If
exclude_highly_expressed=True, consider cells as highly expressed that have more counts thanmax_fractionof the original total counts in at least one cell.- layer
str|None(default:None) Layer to normalize instead of
X. IfNone,Xis normalized.- inplace
bool(default:True) Whether to update
adataor return the matrix.- copy
bool(default:False) Whether to return a copy or update
adata. Not compatible with inplace=False.
- adata
- Return type:
Union[AnnData,csr_matrix,ndarray,None]- Returns:
Returns a normalized copy or updates
adatawith a normalized version of the originaladata.Xandadata.layers['layer'], depending oninplace.