scFates.pp.batch_correct

scFates.pp.batch_correct(adata, batch_key, layer='X', depth_scale=1000.0, device='cpu', inplace=True)

batch correction of the count matrix.

Code has been translated from pagoda2 R function setCountMatrix (plain model).

Parameters
adata

Annotated data matrix.

batch_key

Column name to use for batch.

layer

Which layer to correct, if layer doesn’t exist, then correct X and save to layer

depth_scale

Depth scale.

device

Run method on either cpu or on gpu.

copy

Return a copy instead of writing to adata.

Returns

adata – if inplace=False it returns the corrected matrix, else it update field to adata:

.X

batch-corrected count matrix.

Return type

anndata.AnnData