Skip to content

msmu.pp.correct_batch_effect

Batch correction methods for MuData object. GIS-based normalization, median centering, ComBat, and continuous batch correction (with lowess) are supported.

Parameters:

Name Type Description Default
mdata MuData

MuData object to batch correct.

required
method Literal['gis', 'median_center', 'combat', 'continuous']

Batch correction method to use. Options are 'gis', 'median_center', 'combat', 'continuous'.

required
category str

Category in .obs to use for batch correction.

required
modality str

Modality to batch correct.

required
layer str | None

Layer to batch correct. If None, the default layer (.X) will be used.

None
gis_samples list[str] | None

List of GIS samples.

None
drop_gis bool

If True, GIS samples will be dropped after correction. Default is True.

True
rescale bool

If True, rescale the data after batch correction with median value across dataset (except combat).

True
log_transformed bool

If True, data is assumed to be log-transformed. Default is True.

True

Returns:

Type Description
MuData

Batch corrected MuData object.