ehrapy.preprocessing.regress_out

ehrapy.preprocessing.regress_out(adata, keys, n_jobs=None, copy=False)[source]

Regress out (mostly) unwanted sources of variation.

Uses simple linear regression. This is inspired by Seurat’s regressOut function in R [Satija15]. Note that this function tends to overcorrect in certain circumstances.

Parameters:
Return type:

Optional[AnnData]

Returns:

Depending on copy returns or updates an AnnData object with the corrected data matrix.