Skip to content

Import of BigWig files with rtracklayer fails under MultiCoreParam #111

Open
@MalteThodberg

Description

I'm seeing a weird bug in in my CAGEfightR package when trying to import BigWigFiles.

Here's a reproducible example:

# Load the example data
library(BiocParallel)
library(rtracklayer)
library(CAGEfightR)
data('exampleDesign')

# Example bigwig files
bw_plus <- system.file('extdata', exampleDesign$BigWigPlus,
                       package = 'CAGEfightR')
bw_plus <- BigWigFileList(bw_plus)

# Genome
mm9 <- SeqinfoForUCSCGenome("mm9")
grl <- tileGenome(mm9, ntile=3)

# Import, knowing that some areas will be empty
import(bw_plus[[1]], which=grl[[1]]) # empty
import(bw_plus[[1]], which=grl[[2]]) # empty
import(bw_plus[[1]], which=grl[[3]]) # has signal

# This works
lapply(bw_plus, import, which=grl[[1]])
lapply(bw_plus, import, which=grl[[2]])
lapply(bw_plus, import, which=grl[[3]])

# This works
register(SerialParam())
bplapply(bw_plus, import, which=grl[[1]])
bplapply(bw_plus, import, which=grl[[2]])
bplapply(bw_plus, import, which=grl[[3]])

# This works
register(MulticoreParam(3))
bplapply(bw_plus, import)

# This fails!
register(MulticoreParam(3))
bplapply(bw_plus, import, which=grl[[1]])
bplapply(bw_plus, import, which=grl[[2]])
bplapply(bw_plus, import, which=grl[[3]])

To summarize:

  • You can import entire BigWig-files using bplapply.
  • You can import part of a BigWig using bplapply and SerialParam
  • You cannot import an empty tile from a BigWig file with bplapply and MultiCoreParam.

What's causing this strange behavior?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions