Parallel version of cn.mops' bamDataRanges I am trying to run cn.MOPS to detect CNVs in multiple bam files. Following the example code, I have run:

source("https://bioconductor.org/biocLite.R")
biocLite("cn.mops")
options(width=75)
set.seed(0)
library(cn.mops)
library(Biobase)
library(GenomicRanges)
library(GenomeInfoDb)
cn.mopsVersion &lt;- packageDescription("cn.mops")$Version
library(cn.mops)
BAMFiles &lt;- c('bam1.bam', 'bam2.bam', ..., 'bamN.bam')
bamDataRanges &lt;- getReadCountsFromBAM(BAMFiles)

PLEASE BE PATIENT... this might take a while. Consider using the parallel version of this function


Since this is indeed taking a while, I'd like to follow the tool's suggestion and use "the parallel version of this function". But how do I do that? I don't see any mention of "parallel" in the manual. Is there some standard Bioconductor/R trick to make a function parallel? Am I missing something in the manual? 

How can I run bamDataRanges parallelized?
This is an option for the function documented in its help page. Just run ?bamDataRanges and you will see:

Usage:

     getReadCountsFromBAM(BAMFiles, sampleNames, refSeqNames, WL = 25000,
       parallel = 0, ...)

[...]

parallel: The number of parallel processes to be used for this
          function. Default=0.


So all you need to run with 10 cores is:

bamDataRanges &lt;- getReadCountsFromBAM(BAMFiles, parallel=10)