runSCMerge {singleCellTK} | R Documentation

## Apply scMerge batch effect correction method to SingleCellExperiment object

### Description

The scMerge method leverages factor analysis, stably expressed genes (SEGs) and (pseudo-) replicates to remove unwanted variations and merge multiple scRNA-Seq data.

### Usage

    runSCMerge(
      inSCE,
      useAssay = "logcounts",
      batch = "batch",
      assayName = "scMerge",
      seg = NULL,
      kmeansK = NULL,
      cellType = "cell_type",
      nCores = 1L
    )

### Arguments

`inSCE` | SingleCellExperiment inherited object. Required.
`useAssay` | A single character indicating the name of the assay requiring batch correction. Default `"logcounts"`.
`batch` | A single character indicating a field in `colData` that annotates the batches. Default `"batch"`.
`assayName` | A single characeter. The name for the corrected assay. Will be saved to `assay`. Default `"scMerge"`.
`seg` | A vector of gene names or indices that specifies SEG (Stably Expressed Genes) set as negative control. Pre-defined dataset with human and mouse SEG lists is available to user by running `data('SEG')`. Default `NULL`, and this value will be auto-detected by default with `scSEGIndex`.
`kmeansK` | An integer vector. Indicating the kmeans' K-value for each batch (i.e. how many subclusters in each batch should exist), in order to construct pseudo-replicates. The length of codekmeansK needs to be the same as the number of batches. Default `NULL`, and this value will be auto-detected by default, depending on `cellType`.
`cellType` | A single character. A string indicating a field in `colData(inSCE)` that defines different cell types. Default `'cell_type'`.
`nCores` | An integer. The number of cores of processors to allocate for the task. Default `1L`.

### Value

The input SingleCellExperiment object with `assay(inSCE, assayName)` updated.

### References

Hoa, et al., 2020

### Examples

    data('sceBatches', package = 'singleCellTK')
    ## Not run:
    logcounts(sceBatches) <- log(counts(sceBatches) + 1)
    sceCorr <- runSCMerge(sceBatches)

    ## End(Not run)

[Package singleCellTK version 2.2.0 Index]