Skip to content

Harmony integration failed on one sample - how to fix that? #276

Description

@osschneile

Hello,

I am using harmony integration on my scRNAseq experiment. But looking at the DimPlot, the integration seems to fail on sample om2039.
This sample contains a very high number of cells (10K, others have around 2-6K). Can that cause the problem and how can I fix that without loosing too much cells?

My code:
merg_sc <- merg_sc %>%
Seurat::NormalizeData(verbose = FALSE) %>%
FindVariableFeatures(selection.method = "vst", nfeatures = 3000) %>%
ScaleData(features = rownames(merg_sc), verbose = FALSE) %>%
RunPCA(verbose = FALSE)

#batch correction with harmony
options(repr.plot.height = 2.5, repr.plot.width = 6)
sc_harmony <- merg_sc %>%
RunHarmony("orig.ident", plot_convergence = TRUE)
rm(merg_sc, sample_ids, sample_list,p1)

#extract harmony embeddings
harmony_embeddings <- Embeddings(sc_harmony, 'harmony')
write.csv(harmony_embeddings, file = paste(output_path, "harmony_embeddings.csv", sep = ""))

#now lets explore cluster
sc_harmony <- sc_harmony %>%
RunUMAP(reduction = "harmony", dims = 1:50) %>% #adjust dimensions
FindNeighbors(reduction = "harmony", dims = 1:50) %>%
FindClusters(resolution = 0.3) #adjust resolution

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions