.normalize_median
- proteopy.pp.normalize_median(adata, method, log_space, fill_na=None, zeros_to_na=False, batch_id=None, inplace=True, force=False)[source]
Median normalization of intensities.
- Parameters:
adata (AnnData) – Input AnnData.
method ({'max_ref', 'median_ref'}) – How to choose the reference across sample medians.
'max_ref'uses the maximum sample median,'median_ref'uses the median of sample medians.log_space (bool) – Whether the input intensities are log-transformed. Mismatches with automatic detection raise unless
force=True.fill_na (float, optional) – Temporarily replace non-finite entries with this value for the median computation only; original values are restored afterward.
zeros_to_na (bool, default False) – Treat zeros as missing for the median computation only; original zeros are restored afterward.
batch_id (str, optional) – Column in
adata.obsto perform normalization within batches.inplace (bool, default True) – Modify
adatain place. If False, return a copy.force (bool, default False) – Proceed even if
log_spacedisagrees with automatic log detection.
Notes
- Median normalization:
log_space=TrueX + ref - sample_medianlog_space=FalseX * ref / sample_median'max_ref'reference = max of sample medians (within batch if per_batch)
'median_ref'reference = median of sample medians (within batch if per_batch)