jaleesr / BITFAM

BITFAM is a Bayesian approach and platform to infer transcription factor activities within individual cells using single cell RNA-sequencing data. Please see Gao S et al., Genome Research (2021) https://genome.cshlp.org/content/31/7/1296 for details.
31 stars 16 forks source link

BITFAM doesn't run parallel #6

Closed VergaJU closed 1 year ago

VergaJU commented 1 year ago

Thanks to all the group for the interesting package

I am trying to run BITFAM with my single-cell RNA-Seq dataset following the instruction provided in the GitHub pages It looks running correctly but even if I specify in the arguments to use all the cores of my machine, it looks like running with a single core:

BITFAM_res <- BITFAM(data = data_matrix_normalized, species = "human", scATAC_obj = NA, ncores = parallel::detectCores())

Screenshot from 2023-03-13 15-18-39

I tested it on my local machine and on a remote VM but the result is always the same. I also try to use BiocParallel but the BPPARAM parameter wasn't used. Is there anything I am missing or that I can do to parallelize the computation?

EDIT: I tested BiocParallel to verify that I use more than a CPU per time and it worked, and this is the warning I receive when I run BITFAM:

rstan (Version 2.21.8, GitRev: 2e1f913d3ca3)
For execution on a local, multicore CPU with excess RAM we recommend calling
options(mc.cores = parallel::detectCores()).
To avoid recompilation of unchanged Stan programs, we recommend calling
rstan_options(auto_write = TRUE)

Thanks for the help Jacopo

sgao30 commented 1 year ago

Dear Jacopo,

Thank you for using our tool! The variational bayes function (vb) in Rstan does not support multi-cores. The part that using multi-cores is initializing the model which is before the VB is running.

Please let us know if you have other questions. Thank you!

Best regards, Shang