scReplicate: Create replicate matrix for scMerge algorithm

Description Usage Arguments Value Author(s) Examples

View source: R/scReplicate.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
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,
  BPPARAM = SerialParam(),
  return_all = FALSE,
  BSPARAM = ExactParam(),
  plot_igraph = TRUE,
  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 indicating the ratio of cells that are included in pseudo-replicates, ranges from 0 to 1. Default 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.

BPPARAM

A BiocParallelParam class object from the BiocParallel package is used. Default is SerialParam().

return_all

If FALSE, only return the replicate matrix.

BSPARAM

A BiocSingularParam class object from the BiocSingular package is used. Default is ExactParam().

plot_igraph

If TRUE, then during the un/semi-supervised scMErge, igraph plot will be displayed

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

1
2
3
4
5
6
7
## 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))

scMerge documentation built on Nov. 8, 2020, 7:04 p.m.