Learn R Programming

MALDIquant (version 1.12)

MALDIquant-parallel: Parallel Support in Package MALDIquant

Description

MALDIquant offers multi-core support using mclapply and mcmapply. This approach is limited to unix-based platforms.

Please note that not all functions benfit from parallelisation. Often the overhead to create/copy objects outrun the time saving of parallel runs. This is true for functions that are very fast to compute (e.g. sqrt-transformation). That's why the default value for the mc.cores argument in all functions is 1L. It depends on the size of the dataset which step (often only removeBaseline and detectPeaks) benefits from parallelisation.

Arguments

Details

The following functions/methods support the mc.cores argument: ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

See Also

mclapply, mcmapply

Examples

Run this code
## load package
library("MALDIquant")

## load example data
data("fiedler2009subset", package="MALDIquant")

## run single-core baseline correction
print(system.time(
  b1 <- removeBaseline(fiedler2009subset, method="SNIP")
))

if(.Platform$OS.type == "unix") {
  ## run multi-core baseline correction
  print(system.time(
    b2 <- removeBaseline(fiedler2009subset, method="SNIP", mc.cores=2)
  ))
  print(all.equal(b1, b2))
}

Run the code above in your browser using DataLab