Harmony Integration
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,
...
)
An Assay5
object
A dimensional reduction to correct
Ignored
Ignored
Name of new integrated dimensional reduction
Ignored
If doing PCA on input matrix, number of PCs to compute
Key for Harmony dimensional reduction
Diversity clustering penalty parameter
Ridge regression penalty parameter
Width of soft kmeans clusters
Number of clusters in model
Protection against overclustering small datasets with large ones
What proportion of cells to update during clustering
Maximum number of rounds to run Harmony
Maximum number of rounds to run clustering at each round of Harmony
Convergence tolerance for clustering round of Harmony
Convergence tolerance for Harmony
Whether to print progress messages. TRUE to print, FALSE to suppress
Ignored
...
This function requires the harmony package to be installed
harmony::HarmonyMatrix()
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)
}