satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.18k stars 891 forks source link

Uncertain workflow for differential expression testing after SC Transform v2 + Harmony integration using IntegrateLayers #8998

Open jcm6t opened 4 weeks ago

jcm6t commented 4 weeks ago

Following the published vignette at the bottom of https://satijalab.org/seurat/articles/seurat5_integration for integration of sctransform-normalized data using Harmony. 8 separate samples normalized using SCT, data from same 10X kit and cell ranger processing. 4 WT vs 4 KO.

obj <- SCTransform(obj)
obj <- RunPCA(obj, npcs = 30, verbose = F)
obj <- IntegrateLayers(obj, method = HarmonyIntegration,
  orig.reduction = "pca", new.reduction = "harmony")
obj <- FindNeighbors(obj, dims = 1:30, reduction = "harmony")
obj <- FindClusters(obj, resolution = 0.7)

The pre-merge object looks like this:

obj An object of class Seurat 46233 features across 103670 samples within 2 assays Active assay: SCT (23114 features, 3000 variable features) 3 layers present: counts, data, scale.data 1 other assay present: RNA 3 dimensional reductions calculated: pca, umap, integrated.harm

dim(so) [1] 23114 103670

table(so$orig.ident)

KO3 KO4 KO5 KO6 WT1 WT2 WT7 WT8 10360 9938 11208 10525 11460 14367 17766 18046

We next wanted to run diff expression using PrepSCTFindMarkers and it seemed we needed to merge first since we received the following error from PrepSCTFindMarkers(obj)

Recorrecting SCT counts using minimum median counts: 3602 Error in fn(): ! Cannot add new cells with [[<-

On merging:

obj.merge <- merge(obj)

but received the error: Error in if (!all(names(x = idents) == colnames(x = object))) { : missing value where TRUE/FALSE needed Calls: merge ... validObject -> anyStrings -> isTRUE -> validityMethod Execution halted

This is probably an incorrect workflow issue since the vignette https://satijalab.org/seurat/archive/v4.3/sctransform_v2_vignette is geared towards separate integration anchor steps and Pearson residuals.

Has anyone worked through this process of DE with SCT v2 + harmony integration ? Thanks.

jcm6t commented 4 weeks ago

FYI, this is an analysis question rather than a bug. disregard 'bug' label.