kdkorthauer / dmrseq

R package for Inference of differentially methylated regions (DMRs) from bisulfite sequencing
MIT License
54 stars 14 forks source link

Error: Biocparallel errors - element index: 1, 2, 3, 4, 5, 6... #27

Closed sebcomarmond closed 5 years ago

sebcomarmond commented 5 years ago

Hi @kdkorthauer,

I am running some tests with simDMRs to find which parameters to use so as to increase the number of detected DMRs within my dataset. However, I meet with the following error message every time I try to set Block=TRUE no matter the blockSize I try.

error SIMdmr

The dataset consists of triplicates for two different conditions. To run the simulation, a bs.null object was created containing only the control samples.

Except from the creation of the bs object, the command lines executed are as follows:

bs.null <- bs[, c(1, 2, 3, 1)]
sim_res <- simDMRs(bs = bs.null, num.dmrs = mynumdmrsim, delta.max0 = mydeltamax)
bs.sim <- sim_res$bs
ct <- c( rep("cond_A", 2), rep("cond_B", 2) )
rep <- c( paste("repl_", 1:2, sep = ""), paste("repl_", 1:2, sep = "") )
col <- c( rep(first_col, 2), rep(second_col, 2) )
df <- data.frame( CellType = ct, Rep = rep, col = col )
pData(bs.null) <- df
pData(bs.sim) <- df

r <- dmrseq(bs = bs.null, cutoff = 0.01, testCovariate = "CellType", block = TRUE, blockSize = 1000, minNumRegion = 5, minInSpan= 30, bpSpan= 1000, maxGapSmooth= 2500, chrsPerChunk = num_chroms)
regions.null <- sort(r)
r <- dmrseq(bs = bs.sim, cutoff = 0.01, testCovariate = "CellType", block = TRUE, blockSize = 1000, minNumRegion = 5, minInSpan= 30, bpSpan= 1000, maxGapSmooth= 2500, chrsPerChunk = num_chroms)
regions.sim <- sort(r)

I cannot find the reason behind the error message. Could you please help find the reason for such an error message or an alternative that would allow the use of blockSize in my case ?

kdkorthauer commented 5 years ago

Hi @sebcomarmond,

Thank you for reporting this issue. I am not able to reproduce this error and I'm not sure what could be causing it.

Does the error still occur if you run dmrseq on a single chromosome or some other smaller subset of your BSseq object? If so, would you be able to send me the example subset object as an .rds file so that I can track down the problem? You can send via email to keegan@jimmy.harvard.edu. If the object is too large to send over email, I can provide a dropbox link for you to use.

Best, Keegan

kdkorthauer commented 5 years ago

Hi @sebcomarmond,

Thank you for sending me the example bsseq objects. I was able to reproduce the error and track down the issue. The bug was due to not properly combining nearby block segments while paying attention to different chromosomes/contigs and I've just pushed a fix. Following the fix, I am able to run dmrseq successfully on the example objects.

The new version is available on Github immediately, and on Bioc release and devel in the next day or so. Please try it out and let me know if it remedies the issue for you on the full set.

Best, Keegan

sebcomarmond commented 5 years ago

Hi @kdkorthauer ,

Thanks a lot for your help. After implementing the updated version of dmrseq from Github, the problem was solved even when working on a bigger dataset.

Best regards, Sebastien