Learn R Programming

Seurat (version 5.0.3)

HarmonyIntegration: Harmony Integration

Description

Harmony Integration

Usage

HarmonyIntegration(
  object,
  orig,
  features = NULL,
  scale.layer = "scale.data",
  new.reduction = "harmony",
  layers = NULL,
  npcs = 50L,
  key = "harmony_",
  theta = NULL,
  lambda = NULL,
  sigma = 0.1,
  nclust = NULL,
  tau = 0,
  block.size = 0.05,
  max.iter.harmony = 10L,
  max.iter.cluster = 20L,
  epsilon.cluster = 1e-05,
  epsilon.harmony = 1e-04,
  verbose = TRUE,
  ...
)

Value

...

Arguments

object

An Assay5 object

orig

A dimensional reduction to correct

features

Ignored

scale.layer

Ignored

new.reduction

Name of new integrated dimensional reduction

layers

Ignored

npcs

If doing PCA on input matrix, number of PCs to compute

key

Key for Harmony dimensional reduction

theta

Diversity clustering penalty parameter

lambda

Ridge regression penalty parameter

sigma

Width of soft kmeans clusters

nclust

Number of clusters in model

tau

Protection against overclustering small datasets with large ones

block.size

What proportion of cells to update during clustering

max.iter.harmony

Maximum number of rounds to run Harmony

max.iter.cluster

Maximum number of rounds to run clustering at each round of Harmony

epsilon.cluster

Convergence tolerance for clustering round of Harmony

epsilon.harmony

Convergence tolerance for Harmony

verbose

Whether to print progress messages. TRUE to print, FALSE to suppress

...

Ignored

See Also

harmony::HarmonyMatrix()

Examples

Run this code
if (FALSE) {
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we integrate layers with added parameters specific to Harmony:
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration, orig.reduction = "pca",
  new.reduction = 'harmony', verbose = FALSE)

# Modifying Parameters
# We can also add arguments specific to Harmony such as theta, to give more diverse clusters
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration, orig.reduction = "pca",
  new.reduction = 'harmony', verbose = FALSE, theta = 3)
# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration,
  orig.reduction = "pca", new.reduction = 'harmony',
  assay = "SCT", verbose = FALSE)
}


Run the code above in your browser using DataLab