CellChat
CellChat copied to clipboard
Use progressr with future framework for progress updates
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 thenetClustering
function (similar PRs: #574 and #682) and replace it with eithermultisession
ormulticore
depending on the detected OS type (multicore
is significant faster thanmultisession
in the Linux environment that I am using). - Parallelise the calculation of
Pboot
(default with 100 permutations) in thecomputeCommunProb
function, which was running sequentially before. The update should significantly speed upcomputeCommunProb()
.