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

object

Format

An object of class Seurat with 3000 rows and 2000 columns.

Arguments

seurat_object

Seurat-class object

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)

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.