omicverse.single.batch_correction#
- omicverse.single.batch_correction(adata, batch_key, use_rep='scaled|original|X_pca', methods='harmony', n_pcs=50, **kwargs)[source]#
Run batch-effect correction for single-cell data integration.
- Parameters:
adata (anndata.AnnData) – Input data matrix. Different methods require different preprocessing: for example,
scVItypically needs raw counts inadata.layers['counts'].batch_key (str) – Column in
adata.obsdefining batch/domain labels.use_rep (str, default='scaled|original|X_pca') – Embedding key used by embedding-based methods (for example Harmony).
methods (str, default='harmony') – Integration backend. Supported values include
'harmony','combat','scanorama','scVI','CellANOVA','Concord', and'cca'/'seurat_cca'— the pure-Python port ofSeurat::RunCCA(via the pyccasc package, no R / rpy2 required).n_pcs (int, default=50) – Number of principal components / canonical components used by the selected backend. For
'cca'this is the number of canonical components (num_ccin pyccasc terms).**kwargs – Additional method-specific keyword arguments passed to the selected backend implementation.
- Returns:
Returns
adatafor most methods, scVI model object for'scVI', and Concord object for'Concord'. The integrated embeddings are written toadata.obsm.- Return type: