batch.removal: Remove batch effect

View source: R/batch.removal.R

batch.removalR Documentation

Remove batch effect

Description

It removes posible batch effects present in multiple FCS stored in a FCS.SCE object. It based on:

  1. Seurat's Canonical Correlation Analysis (CCA) or Reciprocal PCA (RPCA), see the tutorial for more information (another one).

  2. Harmony's methodology.

Usage

batch.removal(
  fcs.SCE,
  assay.i = "transformed",
  method,
  batch,
  new.matrix.name = "normalized",
  harmony.params = NULL,
  seurat.params = NULL,
  threads = NULL
)

Arguments

fcs.SCE

A fcs.SCE object generated through FlowCT::fcs.SCE().

assay.i

Name of matrix stored in the fcs.SCE object from which calculate correlation. Default = "transformed".

method

Methodology to perform batch correction. Possible values are "Seurat" or "harmony".

batch

Variable name from colData(FCS.SCE) object to remove batch effect.

new.matrix.name

New normalized matrix name (it will stored within the fcs.SCE object). Default = "normalized".

harmony.params

List with those options from original harmony::HarmonyMatrix() function that user wants to customize. Default, harmony's default ones.

seurat.params

List with those options from original FindIntegrationAnchors() function that user wants to customize. Default, Seurat's default ones except dims = 1:10 and reduction = "rpca" (the other option is "cca", but slower for typical flow cytometry dataset sizes).

threads

Number of threads for multithreading. Default = NULL (i.e., all available cores minus one).

Examples

## Not run: 
 fcs <- batch.removal(fcs, method = "harmony", batch = "patient_id", 
   new.matrix.name = "harmony")
 fcs <- batch.removal(fcs, method = "harmony", batch = "patient_id", 
   new.matrix.name = "harmony",
   harmony.params = list(plot_convergence = T)) #display optimal number of iterations
 fcs <- batch.removal(fcs, method = "seurat", batch = "patient_id", 
   seurat.params = list(reduction = "cca"))
 fcs <- batch.removal(fcs, method = "seurat", batch = "patient_id",
 	              seurat.params = list(reduction = "cca", dims = 1:50))

## End(Not run)

jgarces02/FlowCT documentation built on March 28, 2023, 12:42 p.m.