pytometry.preprocessing.compensate#
- pytometry.preprocessing.compensate(adata, comp_matrix=None, matrix_type='spillover', inplace=True)#
Computes compensation for data channels.
- Parameters
adata (AnnData) – AnnData object
key (str, optional) – key where result vector is added to the adata.var. Defaults to ‘signal_type’.
comp_matrix (pd.DataFrame, optional) – a custom compensation matrix. Please note that by default we use the spillover matrix directly for numeric stability.
matrix_type (str, optional) – 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
tocompensation
.inplace (bool, optional) – Return a copy instead of writing to adata. Defaults to True.
- Return type
Optional
[AnnData
]- Returns
Depending on
inplace
, returns or updatesadata