CellChat icon indicating copy to clipboard operation
CellChat copied to clipboard

Hard coded future.globals.maxSize in netClustering function overrides user's settings

Open davidsanin opened this issue 6 months ago • 0 comments

Thanks for the awesome package! I've been trying to run netClustering on a fairly large object, and kept bumping into the future.globals.maxSize error, which was weird as I had manually set it much higher than what the warning suggested.

I inspected the code of the function and noticed that in the "do.parallel" if statement, there is a hard coded future.globals.maxSize argument that overrides my settings. This is problematic as it prevents any processing of my object and is not something I can easily adjust. I also think generally hard coding those type of settings in packages is advised against.

Here is the relevant section of the netClustering function:

if (do.parallel) {
                with(future::plan("multisession", workers = nCores), 
                  local = TRUE)
                options(future.globals.maxSize = 1000 * 1024^2)
            }

For my use case, I guess I either re-write the function without that line or else do do.parallel = F and wait a long time!

I am running CellChat on version 2.2.0.

davidsanin avatar Oct 08 '25 16:10 davidsanin