Adjusts cell embeddings and gene expression data to account for variations due to user specified variable

harmonyBatchCorrect(
  object,
  nvar = 2000,
  genes.to.add = c(),
  group.by.var,
  npc = 20
)

Arguments

nvar

Number of variable genes to subset the gene expression data by (Default: 2000)

genes.to.add

Add genes that might not be found among variably expressed genes

group.by.var

Which variable should be accounted for when running batch correction

npc

Number of principal components to use when running Harmony (Default: 20)

seurat_object

Seurat-class object

Value

A list: adj.object with harmony-adjusted gene expression (SCT slot) adj.tsne: harmonized tSNE plot

Details

Runs singular value decomposition on pearson residuals (SCT scale.data) to obtain PCA embeddings. Performs harmony on decomposed embedding and adjusts decomposed gene expression values by harmonized embedding.