CellChat icon indicating copy to clipboard operation
CellChat copied to clipboard

Use progressr with future framework for progress updates

Open ycl6 opened this issue 9 months ago • 0 comments

This PR changes how some functions deal with sequential and parallel processes.

Following the suggestion in #424 and discussion in #140 regarding the missing future.seed setting, I dropped the detection of number of cores and the ifelse switch between pbapply::pbsapply and future.apply::future_sapply for sequential and parallel computing respectively, and opted to use the progressr package for progress updates. The package came installed with CellChat, so there is no need to install additional dependencies.

I also:

  • Remove the deprecated future plan multiprocess in the netClustering function (similar PRs: #574 and #682) and replace it with either multisession or multicore depending on the detected OS type (multicore is significant faster than multisession in the Linux environment that I am using).
  • Parallelise the calculation of Pboot (default with 100 permutations) in the computeCommunProb function, which was running sequentially before. The update should significantly speed up computeCommunProb().

ycl6 avatar Sep 28 '23 16:09 ycl6