scanpy.pp.combat
- scanpy.pp.combat(adata, key='batch', covariates=None, inplace=True)
- ComBat function for batch effect correction [Johnson07] [Leek12] [Pedersen12]. - Corrects for batch effects by fitting linear models, gains statistical power via an EB framework where information is borrowed across genes. This uses the implementation combat.py [Pedersen12]. - Parameters
- adata : AnnDataAnnData
- Annotated data matrix 
- key : strstr(default:'batch')
- Key to a categorical annotation from - obsthat will be used for batch effect removal.
- covariates : Collection[str] |NoneOptional[Collection[str]] (default:None)
- Additional covariates besides the batch variable such as adjustment variables or biological condition. This parameter refers to the design matrix - Xin Equation 2.1 in [Johnson07] and to the- modargument in the original combat function in the sva R package. Note that not including covariates may introduce bias or lead to the removal of biological signal in unbalanced designs.
- inplace : boolbool(default:True)
- Whether to replace adata.X or to return the corrected data 
 
- adata : 
- Return type
- Returns
- Depending on the value of - inplace, either returns the corrected matrix or or modifies- adata.X.