khabbazian / l1ou

Detection of evolutionary shifts in Ornstein-Uhlenbeck models
GNU General Public License v2.0
19 stars 7 forks source link

Empty profile when using multiple cores #54

Open rmarquezp opened 10 months ago

rmarquezp commented 10 months ago

Hello!

When running the estimate_shift_configuration function with multiple cores the profiles element in the output, where the different configurations and their scores should be, comes back empty. This doesn't happen when using a single core. Below is an example of how I'm getting this issue with example data:

library(l1ou)

data(lizard.tree, lizard.traits)
lizard <- adjust_data(lizard.tree, lizard.traits[,1])

# the new tree is normalized: each tip at distance 1 from the root.
# new Y: matrix of size 100 x 1 

eModel <- estimate_shift_configuration(lizard$tree, lizard$Y)

# Starting first LASSO (alpha=0) to find a list of candidate configurations.
# Starting second LASSO (alpha= 0.61 ) for another list of candidates.

str(eModel$profile)

# List of 2
#  $ scores        : num [1:2399] 16.8 18.3 18.7 19.3 19.9 ...
#  $ configurations:List of 2399
#   ..$ : num [1:8] 14 32 55 74 77 98 118 164
#   ..$ : num [1:7] 14 32 55 77 98 118 164
#   ..$ : num [1:6] 14 32 77 98 118 164
#   ..$ : num [1:9] 14 32 37 55 74 77 98 118 164

# [etc...]

Now multithreaded, produces an empty profile

eModel_mc <- estimate_shift_configuration(lizard$tree, lizard$Y, nCores = 4)

str(eModel_mc$profile)

# List of 2
#  $ scores        : num(0)
#  $ configurations: list()

I'm running R v. 4.22 and l1ou v. 1.43.

Thanks!

PatriciaPI commented 9 months ago

Hello! I have the same issue with both the "estimate_shift_configuration" and the "l1ou_bootstrap_support" when using multiple cores. Thanks!