omicverse.single.batch_correction#
- omicverse.single.batch_correction(adata, batch_key, use_rep='scaled|original|X_pca', methods='harmony', n_pcs=50, **kwargs)[源代码]#
Run batch-effect correction for single-cell data integration.
- 参数:
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','scANVI'(semi-supervised VAE; requireslabels_key=),'totalVI'(joint RNA+protein; requiresprotein_expression_obsm_key=),'scPoli'(scArches conditional VAE; supportscell_type_keys=for prototype learning),'CellANOVA','Concord','cca'/'seurat_cca'— the pure-Python port ofSeurat::RunCCA(via the pyccasc package, no R / rpy2 required) — and'rpca'/'seurat_rpca'— a faithful Python port of Seurat’sIntegrateLayers(method = RPCAIntegration)(reciprocal-PCA anchors, no R required; writesadata.obsm['X_rpca']). RPCA acceptsfeatures=,reference=,k_anchor=,k_weight=,sd_weight=andorig_rep=(the joint reduction to correct).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
adatafor most methods, scVI model object for'scVI', and Concord object for'Concord'. The integrated embeddings are written toadata.obsm.- 返回类型: