# Normalize, HVG, scale
seurat <- NormalizeData(seurat)
seurat <- FindVariableFeatures(seurat)
seurat <- ScaleData(seurat)
# PCA
seurat <- RunPCA(seurat)
# Run Harmony
seurat <- RunHarmony(seurat,
group.by.vars = "Donor",
reduction = "pca",
dims.use = 1:30,
assay.use = "RNA",
reduction.save = "harmony")
# UMAP
seurat <- RunUMAP(seurat,
reduction = "harmony",
dims = 1:30)
# Clusters
seurat <- FindNeighbors(seurat,
reduction = "harmony",
dims = 1:30)
seurat <- FindClusters(seurat,
resolution = 0.6)
We run PCA on top of the harmony reduction that is calculated during the
IntegrateLayers()step ofHarmonyIntegration. Removing this step should fix the code (where it will just run the SCTransform method)Either fix this or recommend using the simpler
RunHarmony()method: