CorrectBatches {Canek}R Documentation

CorrectBatches

Description

Batch-effect correction over a list of single cell batches

Usage

CorrectBatches(
  lsBatches,
  hierarchical = TRUE,
  queNumCelltypes = NULL,
  maxMem = 5,
  sampling = FALSE,
  numSamples = NULL,
  kNN = 30,
  pcaDim = 50,
  pairsFilter = FALSE,
  perCellMNN = 0.08,
  fuzzy = TRUE,
  fuzzyPCA = 10,
  estMethod = "Median",
  clusterMethod = "louvain",
  doCosNorm = FALSE,
  fracSampling = NULL,
  debug = FALSE,
  verbose = FALSE,
  ...
)

Arguments

lsBatches

List of batches to integrate. Batches should contain the same number of genes as rows.

hierarchical

Use hierarchical integration scheme when correcting more than two batches. If set to FALSE, the input batches are sorted by number of cells and integrated on descending order.

queNumCelltypes

Number of cell types in the query batch. By default Canek searches the number of cell types using an heuristic algorithm. Change this parameter if you know the number of cell types in advanced.

maxMem

Maximum number of memberships from the query batch. This parameter is used on the heuristic algorithm to find the number of cell types.

sampling

Use MNNs pairs sampling when using a Kalman filter to estimate the correction vector.

numSamples

If sampling. Number of MNNs pairs samples to use on the estimation process.

kNN

Number of k-nearest-neighbors used to define the MNNs pairs.

pcaDim

Number of PCA dimensions to use.

pairsFilter

Filter MNNs pairs before estimating the correction vectors. If TRUE, the pairs are filtered from outliers using an interquartile range method.

perCellMNN

Threshold value to decide if a membership's correction value is calculated. As a rough interpretation, this values can be thought as the proportion of cells from a membership with an associated MNN pair. If the proportion is low, an specific correction vectors is not calculated for this membership.

fuzzy

Use fuzzy logic to join the local correction vectors.

fuzzyPCA

Number of PCs to use in the fuzzy process.

estMethod

Method to use when estimating the correction vectors:

  • Median. Use the cells median distance

  • EKF. Use an extended Kalman filter

clusterMethod

Method used to identify memberships.

doCosNorm

Whether to do cosine normalization.

fracSampling

Fraction of cells to sample in the hierarchical selection (default is NULL, no sampling).

debug

Return correction's information

verbose

Print output.

...

Pass down methods from RunCanek().

Details

CorrectBatches is a method to correct batch-effect from two or more single-cell batches. Batch-effects observations are defined using mutual nearest neighbors (MNNs) pairs and cell groups from the query batch are distinguished using clustering. We estimate a correction vector for each cluster using its MNNs pairs and use these vectors to remove the batch effect from the query batch in two ways:

Value

A list containing the integrated datasets as matrix and the correction data .

Examples

Batches <- SimBatches$batches
z <- CorrectBatches(Batches)

Uncorrected_PCA <- prcomp(t(cbind(Batches[[1]], Batches[[2]])))
plot(Uncorrected_PCA$x[,1:2])
Corrected_PCA <- prcomp(t(z))
plot(Corrected_PCA$x[,1:2])


[Package Canek version 0.2.5 Index]