Skip to content

Harmony code #156

@nsohail19

Description

@nsohail19

We run PCA on top of the harmony reduction that is calculated during the IntegrateLayers() step of HarmonyIntegration. 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:

# 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)

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions