scFates.pp.batch_correct

Contents

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 default: 'X'

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

depth_scale default: 1000.0

Depth scale.

device default: 'cpu'

Run method on either cpu or on gpu.

copy

Return a copy instead of writing to adata.

Returns:

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

.X

batch-corrected count matrix.