ELTEbioinformatics / mulea

mulea - an R package for enrichment analysis using various ontologies and empirical false discovery rate
https://www.biorxiv.org/content/10.1101/2024.02.28.582444v1
24 stars 2 forks source link

Revert to a previous approach for using multiple threads #28

Closed stitam closed 8 months ago

stitam commented 8 months ago

The main issue I'm trying to handle is around passing cpp code into cluster nodes.

The approach used to be clusterEvalQ(cl, library("mulea")) so the package was loaded inside each cluster. However, it seems this is not good practice: "Don’t use library() or require(). These modify the search path, affecting what functions are available from the global environment. Instead, you should use the DESCRIPTION to specify your package’s requirements, as described in Chapter 9. This also makes sure those packages are installed when your package is installed. (https://r-pkgs.org/code.html)"

The current version uses clusterEvalQ(cl, devtools::load_all()) however, this only works inside a development environment so it does not work from the user side. Since during usage the package would be installed anyway, it is probably OK to revert this to the original version despite rdrr's suggestion.