pytometry.pp.compensate

Contents

pytometry.pp.compensate#

pytometry.pp.compensate(adata, comp_matrix=None, matrix_type='spillover', inplace=True)#

Computes compensation for data channels.

Parameters:
  • adata (AnnData) – AnnData object.

  • key – Key where result vector is added to the adata.var.

  • comp_matrix (DataFrame (default: None)) – A custom compensation matrix. Please note that by default we use the spillover matrix directly for numeric stability.

  • matrix_type (str (default: 'spillover')) – Whether to use a spillover matrix (default) or a compensation matrix. Only considered for custom compensation matrices. Usually, custom compensation matrices are the inverse of the spillover matrix. If you want to use a compensation matrix, not the spillover matrix, set matrix_type to compensation.

  • inplace (bool (default: True)) – Update adata and return None if True. Otherwise, return a copy of adata with the changes.

Return type:

AnnData | None

Returns:

Depending on inplace, returns or updates adata