Hi,
I am trying to replace doMC package with BiocParallel and I have some questions:
1: Is there a way of registering a backhead and then use plyr package with parallel=TRUE? I have tried everything but it does not seem to work, then I changed dlply etc with bplapply and everything works, however i had to make a lot of ugly modifications to my code in order to use bplapply as it does not break a data.frame like dlply does for example.
2: Now the FUN argument in bplapply is a function which calls another function (function1) and this function1 calls another (function2). I get an error with bplapply that function1 and 2 do not exist. However if i give function1 as an argument, then bplapply does recognize function1 but not function2. Even if i give function2 as an argument, i get the same error, that it does not exist. I guess that this happens because function2 is nested. How can I solve that if I cannot export all those functions to the global environment?
Best
You mean .parallel=TRUE, right? I think it will be very hard to get advice on these questions without concise reproducible examples illustrating the concerns. the .parallel parameter to dlply determines whether iteration will occur using foreach, and I believe there are ways to achieve the export functionality you are looking for with bplapply and DoparParam, but you will have to look closely at foreach documentation (and perhaps sources) to do this.
Yes for .parallel=TRUE.
I have changed the code now to bplapply, the problem is that when I read the instructions for using bplapply, bioconductor states that the BPPARAM argument should be given by the user. So this is where one has to specify which functions to export if I am not wrong. But there are a lot of functions in my package which need to be exported and they are not visible to the user, and at the same time it is not practical for the user to do that.