aertslab / GENIE3

GENIE3 (GEne Network Inference with Ensemble of trees) R-package
26 stars 9 forks source link

Parallel execution of GENIE3 #4

Closed alnf closed 6 years ago

alnf commented 6 years ago

When using nCores parameter I've encountered problem: could not find function "%dopar%"

The code is following:

library(netbenchmark) # needed for dataset
library(GENIE3)
GENIE3(t(gnw2000.data[, 1:20]), nCores=4)

Session info:

> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.3 LTS

Matrix products: default
BLAS: /home/aln/miniconda3/envs/bnf/lib/R/lib/libRblas.so
LAPACK: /home/aln/miniconda3/envs/bnf/lib/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
[1] GENIE3_1.0.0        netbenchmark_1.10.0 grndata_1.10.0     

loaded via a namespace (and not attached):
 [1] igraph_1.1.2        Rcpp_0.12.14        magrittr_1.5       
 [4] PCIT_1.5-3          fdrtool_1.2.15      doParallel_1.0.11  
 [7] xtable_1.8-2        lattice_0.20-35     doRNG_1.6.6        
[10] foreach_1.4.4       stringr_1.2.0       pkgmaker_0.22      
[13] rngtools_1.2.4      tools_3.4.1         c3net_1.1.1        
[16] grid_3.4.1          registry_0.5        corpcor_1.6.9      
[19] iterators_1.0.9     digest_0.6.14       GeneNet_1.2.13     
[22] randomForest_4.6-12 Matrix_1.2-12       codetools_0.2-15   
[25] longitudinal_1.1.12 stringi_1.1.6       pracma_2.1.1       
[28] compiler_3.4.1      minet_3.36.0        pkgconfig_2.0.1    

Any ideas how to fix that? Thanks.

davetang commented 6 years ago

You need to install these two libraries doParallel and doRNG.

alnf commented 6 years ago

@davetang would you be so kind to look closely on my sessionInfo() output?

davetang commented 6 years ago

They are not attached. This works for me:

library(netbenchmark)
library(GENIE3)
library(doParallel)
library(doRNG)
GENIE3(t(gnw2000.data[, 1:20]), nCores=4)
alnf commented 6 years ago

@davetang It seems to help me as well, thx. I thought GENIE would load the packages internally. Closing the issue.

mschubert commented 5 years ago

Forgive me digging up this old issue, but why should those packages be attached?

Is there any advantage of requiring the user to pollute their global namespace in order to run GENIE3 in parallel?