- spac.transformations.batch_normalize(adata, annotation, output_layer, input_layer=None, method='median', log=False)[source]
Adjust the features of every marker using a normalization method.
The normalization methods are summarized here: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8723144/
- Parameters:
adata (anndata.AnnData) – The AnnData object.
annotation (str) – The name of the annotation in adata to define batches.
output_layer (str) – The name of the new layer to add to the anndata object for storing normalized data.
input_layer (str, optional) – The name of the layer from which to read data. If None, read from .X.
method ({"median", "Q50", "Q75", "z-score"}, default "median") – The normalization method to use.
log (bool, default False) – If True, take the log2 of features before normalization. Ensure this is boolean.