rapids_singlecell.pp.normalize_total#
- rapids_singlecell.pp.normalize_total(adata, *, target_sum=None, exclude_highly_expressed=False, max_fraction=0.05, use=None, out=False, key_added=None, 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.- use
LayerAcc|MultiAcc|str|None(default:None) Which matrix to normalize, e.g.
A.X,A.layers['counts']orA.obsm['x']. Strings are resolved byanndata.acc.AdAcc.resolve(), e.g.'layers.counts'.- out
LayerAcc|MultiAcc|str|NormalizeTotalOut|bool(default:False) Where to write the outputs. A single accessor writes
normalizedto it, a mapping (NormalizeTotalOut) writes only the outputs it names, e.g.{'normalized': A.layers['norm'], 'norm_factor': A.obs['nf']}. IfTrue, they are returned as aNormalizeTotalResult. IfFalse,normalizedis written to the placeusereads from andnorm_factorisn’t written.
- adata
- Return type:
- Returns:
None, or aNormalizeTotalResultifout=True.