bsseq BSmooth error
0
0
Entering edit mode
enricoferrero ▴ 660
@enricoferrero-6037
Last seen 2.4 years ago
Switzerland

Hi,

I'm getting this error when using the BSmooth function in bsseq:

covs <- list.files(indir, pattern="\\.bismark.cov$", full.names=TRUE, recursive=TRUE)
bsobj <- read.bismark(files=covs, sampleNames=names(covs), fileType="cov")
fit <- BSmooth(bsobj, mc.cores=ncores, parallelBy="sample", verbose=TRUE)
[BSmooth] preprocessing ... done in 101.7 sec
[BSmooth] smoothing by 'sample' (mc.cores = 16, mc.preschedule = FALSE)
Error in sum(sapply(res, inherits, "try-error")) :
  invalid 'type' (list) of argument
traceback()
6: mclapply(seq(along = sampleNames), function(sIdx) {
       ptime1 <- proc.time()
       tmp <- lapply(clusterIdx, function(jj) {
           try(smooth(idxes = jj, sampleIdx = sIdx))
       })
       coef <- do.call(c, lapply(tmp, function(xx) xx$coef))
       se.coef <- do.call(c, lapply(tmp, function(xx) xx$se.coef))
       ptime2 <- proc.time()
       stime <- (ptime2 - ptime1)[3]
       if (verbose) {
           cat(sprintf("[BSmooth] sample %s (out of %d), done in %.1f sec\n",
               sampleNames[sIdx], length(sampleNames), stime))
       }
       return(list(coef = coef, se.coef = se.coef))
   }, mc.preschedule = mc.preschedule, mc.cores = mc.cores)
5: BSmooth(bsobj, mc.cores = ncores, parallelBy = "sample", verbose = TRUE) at 07differentialMethylation.R#30
4: eval(expr, envir, enclos)
3: eval(ei, envir)
2: withVisible(eval(ei, envir))
1: source("07differentialMethylation.R", echo = TRUE)

 

However I can't reproduce this with the BS.cancer.ex data.

Do you have any idea about what might be causing that error?

I'm using R 3.2.2, Bioconductor 3.2 and bsseq 1.6.0

 

Thank you,

Enrico

bsseq • 1.9k views
ADD COMMENT
0
Entering edit mode

It seems to be related to an old bug in mclapply() that occurs when the number of operations (17 samples in this case) is higher than the number of cores (I'm using 16):

However this should have been fixed years ago.

 

Any idea?

Thanks,

Enrico

ADD REPLY
1
Entering edit mode

If this is the cause of the error, shouldn't you be able to reproduce it using the cancer dataset?

I suggest trying to make the BSseq object small (say 10k CpGs), and if you can reproduce the error, send it (the small object_ to me.

Kasper

ADD REPLY
0
Entering edit mode

BS.cancer.ex is only 6 samples, which is less than the number of cores I'm using (16).

I'll try out your suggestion and let you know how it goes.

Thank you! 

ADD REPLY

Login before adding your answer.

Traffic: 943 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6