You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to express my appreciation for the CellChat package, which has been instrumental in facilitating inference, visualization, and analysis of cell-cell communication from single-cell and spatially resolved transcriptomics.
However, I encountered an issue when using the future package to accelerate computing. Specifically, setting the plan to "multisession" without specifying the number of workers results in an error message: Error in rep(no, length.out = len) : attempt to replicate an object of type 'closure'.
Upon further investigation and debugging, I found that the issue stems from the following statement in your package:
This statement uses ifelse() to determine which function to use based on the number of workers. However, as you noted, this approach may not be suitable due to the vectorized nature of ifelse(). To resolve this issue, I suggest replacing it with a simple conditional assignment:
I'd like to express my appreciation for the CellChat package, which has been instrumental in facilitating inference, visualization, and analysis of cell-cell communication from single-cell and spatially resolved transcriptomics.
However, I encountered an issue when using the
future
package to accelerate computing. Specifically, setting the plan to "multisession" without specifying the number of workers results in an error message:Error in rep(no, length.out = len) : attempt to replicate an object of type 'closure'
.Upon further investigation and debugging, I found that the issue stems from the following statement in your package:
This statement uses
ifelse()
to determine which function to use based on the number of workers. However, as you noted, this approach may not be suitable due to the vectorized nature ofifelse()
. To resolve this issue, I suggest replacing it with a simple conditional assignment:This change should prevent the error from occurring when using "multisession" mode without specifying the number of workers.
If you're short on time, I'd be happy to create a pull request with this fix. Otherwise, thank you for your attention to this matter.
The text was updated successfully, but these errors were encountered: