Entering edit mode
I have been trying to calculate SVs using the sva-package in parallel, but no matter what backend I use, it always fails. Consider for examples this example code based on the vignette:
library(parallel) library(BiocParallel) library(sva) library(bladderbatch) data(bladderdata) # Data from the vignette pheno <- pData(bladderEset) edata <- exprs(bladderEset) mod <- model.matrix(~as.factor(cancer), data=pheno) # Serial execution (Works) svaSerial <- lapply(1:3, function(x) sva(dat=edata, mod=mod, n.sv=x)) # Parallel execution using parallel (Fails) svaSerial <- mclapply(1:3, function(x) sva(dat=edata, mod=mod, n.sv=x), mc.cores=3) # Parallel execution using BioC (Fails) svaSerial <- bplapply(1:5, function(x) sva(dat=edata, mod=mod, n.sv=x), BPPARAM=MulticoreParam(workers=3))
The code executes just fine under lapply
, but mclapply
, bpapply
, etc. fails, without any informative error messages.
Any ideas why this is?