HarmonyIntegration: Harmony Integration

View source: R/integration5.R

HarmonyIntegrationR Documentation

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,
  ...
)

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

Value

...

Note

This function requires the harmony package to be installed

See Also

harmony::HarmonyMatrix()

Examples

## Not run: 
# 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)

## End(Not run)



satijalab/seurat documentation built on March 20, 2024, 8:41 p.m.