batch_correct: Remove batch effect with bulk and reference

View source: R/batch_correct.R

batch_correctR Documentation

Remove batch effect with bulk and reference

Description

This function would perform cross-platform batch effects correction. if object@ref_type = "single_cell", it would use S-mode batch correction method, if object@ref_type = "sort" or "aggre", it would use B-mode batch correction method. We note that this step is not essential step in deconvolution.

Usage

batch_correct(
  object,
  varname_cell_type,
  n_pseudo_bulk = 100,
  sample_size = 1000,
  ncores = 6
)

Arguments

object

ENIGMA object

varname_cell_type

Varname in colData of reference to tell which column is cell type. Only avaliable when reference is single cell RNA-seq data.

n_pseudo_bulk

Number of pseudo bulk samples generated from scRNA reference. Only avaliable when reference is single cell RNA-seq data. Default is 100.

sample_size

Number of sampled cell for reconstituting pseudo-bulk samples. Default is 1000.

Value

For B-mode correction, ENIGMA object where object@bulk contains the corrected bulk gene expression profile. For S-mode correction, ENIGMA object where object@ref contains the corrected reference profile matrix.

Examples

## Not run: 
#S-mode
egm = batch_correct(egm, varname_cell_type = "main_celltype", n_pseudo_bulk=1000)
#B-mode
egm = batch_correct(egm)

## End(Not run)


WWXkenmo/ENIGMA_test documentation built on March 17, 2023, 4:56 a.m.