cycombinepy.correct_data¶
- cycombinepy.correct_data(adata, label_key='cycombine_som', markers=None, batch_key='batch', covar=None, anchor=None, parametric=True, ref_batch=None, layer=None, out_layer='cycombine_corrected', copy=False)[source]¶
Per-cluster ComBat batch correction.
- Parameters:
adata (
AnnData) – AnnData with a cluster label inadata.obs[label_key]and a batch inadata.obs[batch_key].label_key (
str) – Column inadata.obswith the SOM cluster id (fromcreate_som()).markers (
Optional[Iterable[str]]) – Var names to correct. IfNone, usescycombinepy.get_markers().batch_key (
str) – Column inadata.obsgiving the batch assignment.covar (
str|None) – Optionaladata.obscolumns used as ComBat covariates. Skew- and confound-detection follow the R logic at lines 455-506.anchor (
str|None) – Optionaladata.obscolumns used as ComBat covariates. Skew- and confound-detection follow the R logic at lines 455-506.parametric (
bool) – Parametric vs. non-parametric ComBat prior.ref_batch – Optional reference batch that is kept unchanged.
layer (
str|None) – If given, read the uncorrected matrix from this layer rather thanX.out_layer (
str) – Name of the layer to store the corrected matrix in.copy (
bool) – If True, return a corrected copy; otherwise mutate in place.
- Return type: