Integration preprocessing took long (~10min in my case with 120 000 cells and 61 layers). Time was nearly completely spent on Seurat:::CreateIntegrationGroup , more specifically on:
I rewrote this (also thanks to ChatGPT) using logical indexing.
This speeds up computation > 1000x in my use case from 10 min to less than 1 s. So "real" integration steps start nearly instantaneously.
Issue initially reported here: https://github.com/satijalab/seurat/issues/7879
Integration preprocessing took long (~10min in my case with 120 000 cells and 61 layers). Time was nearly completely spent on
Seurat:::CreateIntegrationGroup
, more specifically on:Slow computing here was caused by the sapply function in seurat-object https://github.com/satijalab/seurat-object/blob/58bf437fe058dd78913d9ef7b48008a3e24a306a/R/logmap.R#L238-L247
I rewrote this (also thanks to ChatGPT) using logical indexing. This speeds up computation > 1000x in my use case from 10 min to less than 1 s. So "real" integration steps start nearly instantaneously.
For a reproducible example use: