Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 'future.seed' and 'progressr' in the future framework #177

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ycl6
Copy link

@ycl6 ycl6 commented Jun 26, 2024

A PR with similar changes has been submitted before to CellChat v1 to fix and improve a few issues that seems to have persisted into the v2 version.


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

Following the suggestion in sqjin/CellChat#424 and discussion in sqjin/CellChat#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, which is the recommended way in the future framework.

I also parallelise the calculation of Pboot (default with 100 permutations) in the computeCommunProb function, which was running sequentially previously. The update should significantly speed up computeCommunProb().

@ycl6 ycl6 changed the title Use 'future' and 'progressr' for future framework Use 'future.seed' and 'progressr' in the future framework Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant