scReplicate {scMerge} | R Documentation

## Create replicate matrix for scMerge algorithm

### Description

Create replicate matrix for scMerge algorithm using un-/semi-/supervised approaches.

### Usage

    scReplicate(sce_combine, batch = NULL, kmeansK = NULL,
      exprs = "logcounts", hvg_exprs = "counts", marker = NULL,
      marker_list = NULL, replicate_prop = 1, cell_type = NULL,
      cell_type_match = FALSE, cell_type_inc = NULL, dist = "cor",
      WV = NULL, WV_marker = NULL, parallelParam = SerialParam(),
      return_all = FALSE, fast_svd, verbose = FALSE)

### Arguments

`sce_combine` | A `SingleCellExperiment` object contains the batch-combined matrix with batch info in colData
`batch` | A vector indicates the batch information for each cell in the batch-combined matrix.
`kmeansK` | A vector indicates the kmeans's K for each batch, length of kmeansK needs to be the same as the number of batch.
`exprs` | A string indicates the assay that are used for batch correction, default is logcounts
`hvg_exprs` | A string indicates the assay that are used for highly variable genes identification, default is counts
`marker` | A vector of markers, which will be used in calculation of mutual nearest cluster. If no markers input, highly variable genes will be used instead
`marker_list` | A list of markers for each batch, which will be used in calculation of mutual nearest cluster.
`replicate_prop` | A number indicates the ratio of cells that are included in pseudo-replicates, ranges from 0 to 1
`cell_type` | A vector indicates the cell type information for each cell in the batch-combined matrix. If it is `NULL`, pseudo-replicate procedure will be run to identify cell type.
`cell_type_match` | Whether find mutual nearest cluster using cell type information
`cell_type_inc` | A vector indicates the indices of the cells that will be used to supervise the pseudo-replicate procedure
`dist` | The distance metrics that are used in the calculation of the mutual nearest cluster, default is Pearson correlation.
`WV` | A vector indicates the wanted variation factor other than cell type info, such as cell stages.
`WV_marker` | A vector indicates the markers of the wanted variation.
`parallelParam` | The `BiocParallelParam` class from the `BiocParallel` package is used. Default is SerialParam().
`return_all` | If `FALSE`, only return the replicate matrix.
`fast_svd` | If `TRUE`, fast algorithms will be used for singular value decomposition calculation via the `irlba` and `rsvd` packages. We recommend using this option when the number of cells is large (e.g. more than 1000 cells).
`verbose` | If `TRUE`, then all intermediate steps will be shown. Default to `FALSE`.

### Value

If `return_all` is `FALSE`, return a replicate matrix. If `return_sce` is `TRUE`, return the followings

`repMat` | replicate matrix
`mnc` | mutual nearest cluster
`replicate vector` | replicate vector
`HVG` | highly variable genes used in scReplicate

A cell-replicates mapping matrix. Each row correspond to a cell from the input expression matrix, and each column correspond to a cell-cluster/cell-type. An element of the mapping matrix is 1 if the scReplicate algorithm determines that this cell should belong to that cell cluster and 0 otherwise.

### Author(s)

Yingxin Lin, Kevin Wang

### Examples

    ## Loading example data
    set.seed(1)
    data('example_sce', package = 'scMerge')
    scRep_result = scReplicate(
      sce_combine = example_sce,
      batch = example_sce$batch,
      kmeansK = c(3,3),
      fast_svd = FALSE)

[Package scMerge version 1.0.0 Index]