satijalab / seurat-wrappers

Community-provided extensions to Seurat
GNU General Public License v3.0
307 stars 131 forks source link

The batch argument for FastMNNIntegration via IntegrateLayers is non-functional #193

Open erzakiev opened 6 months ago

erzakiev commented 6 months ago

I was under the impression that the group/batch argument should somehow modify the batch correction outcome, but it doesn't. Is that intended?

pbmcsca <- SeuratData::LoadData("pbmcsca")
pbmcsca -> obj
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)
obj <- IntegrateLayers(object = obj, method = FastMNNIntegration, new.reduction = 'integrated.mnn', verbose = FALSE)

image

pbmcsca -> obj2
obj2[["RNA"]] <- split(obj2[["RNA"]], f = obj2$Method)
obj2 <- NormalizeData(obj2)
obj2 <- FindVariableFeatures(obj2)
obj2 <- ScaleData(obj2)
obj2 <- RunPCA(obj2)
obj2[['RNA']] <- JoinLayers(obj2[['RNA']])
obj2 <- IntegrateLayers(object = obj2, 
                        method = FastMNNIntegration, 
                        new.reduction = 'integrated.mnn', 
                        batch=obj2$Method,
                        verbose = FALSE)
DimPlot(obj2)

image