Learn R Programming

iCellR (version 1.6.1)

run.mnn: Run MNN alignment on the main data.

Description

This function takes an object of class iCellR and runs MNN alignment. It's a wrapper for scran.

Usage

run.mnn(
  x = NULL,
  method = "base.mean.rank",
  top.rank = 500,
  gene.list = "character",
  data.type = "main",
  k = 20,
  cos.norm = TRUE,
  ndist = 3,
  d = 50,
  approximate = FALSE,
  irlba.args = list(),
  subset.row = NULL,
  auto.order = FALSE,
  pc.input = FALSE,
  compute.variances = FALSE,
  assay.type = "logcounts",
  get.spikes = FALSE,
  BNPARAM = NULL,
  BPPARAM = SerialParam()
)

Arguments

x

An object of class iCellR.

method

Choose from "base.mean.rank" or "gene.model", default is "base.mean.rank". If gene.model is chosen you need to provide gene.list.

top.rank

A number taking the top genes ranked by base mean, default = 500.

gene.list

A charactor vector of genes to be used for PCA. If "clust.method" is set to "gene.model", default = "my_model_genes.txt".

data.type

Choose from "main" and "imputed", default = "main"

k

An integer scalar specifying the number of nearest neighbors to consider when identifying MNNs.

cos.norm

A logical scalar indicating whether cosine normalization should be performed on the input data prior to calculating distances between cells.

ndist

A numeric scalar specifying the threshold beyond which neighbours are to be ignored when computing correction vectors. Each threshold is defined in terms of the number of median distances.

d

Number of dimentions to pass to <U+2018>multiBatchPCA<U+2019>.

approximate

Further arguments to pass to <U+2018>multiBatchPCA<U+2019>. Setting <U+2018>approximate=TRUE<U+2019> is recommended for large data sets with many cells.

irlba.args

Further arguments to pass to <U+2018>multiBatchPCA<U+2019>. Setting <U+2018>approximate=TRUE<U+2019> is recommended for large data sets with many cells.

subset.row

See <U+2018>?"scran-gene-selection"<U+2019>.

auto.order

Logical scalar indicating whether re-ordering of batches should be performed to maximize the number of MNN pairs at each step. Alternatively an integer vector containing a permutation of <U+2018>1:N<U+2019> where <U+2018>N<U+2019> is the number of batches.

pc.input

Logical scalar indicating whether the values in <U+2018>...<U+2019> are already low-dimensional, e.g., the output of <U+2018>multiBatchPCA<U+2019>.

compute.variances

Logical scalar indicating whether the percentage of variance lost due to non-orthogonality should be computed.

assay.type

A string or integer scalar specifying the assay containing the expression values, if SingleCellExperiment objects are present in <U+2018>...<U+2019>.

get.spikes

See <U+2018>?"scran-gene-selection"<U+2019>. Only relevant if <U+2018>...<U+2019> contains SingleCellExperiment objects.

BNPARAM

A BiocNeighborParam object specifying the nearest neighbor algorithm. Defaults to an exact algorithm if <U+2018>NULL<U+2019>, see <U+2018>?findKNN<U+2019> for more details.

BPPARAM

A BiocParallelParam object specifying whether the PCA and nearest-neighbor searches should be parallelized.

Value

An object of class iCellR.