scmorph.pp.scale_by_batch

Contents

scmorph.pp.scale_by_batch#

scmorph.pp.scale_by_batch(adata, batch_key, treatment_key=None, control=None, chunked=False)#

Scale data to zero-center and unit variance per batch in-place.

Parameters:
  • adata (AnnData) – Annotated data matrix.

  • batch_key (str) – Name of the column in the AnnData object that contains the batch information.

  • treatment_key (Optional[str] (default: None)) – Name of column used to delinate treatments. This is used when computing batch effects across drug-treated plates. In that case, we compute batch effects only on untreated cells and then apply the correction factors to all cells. If using, please also see control.

  • control (Optional[str] (default: None)) – Name of control treatment. Must be valid value in treatment_key.

  • chunked (bool (default: False)) – Whether to save memory by processing in chunks. This is slower but less memory intensive.

Return type:

None