### R code from vignette source '/home/vobencha/proj/svn/Conferences/Boston14/labs/ParallelBioc/ParallelBioc.Rnw' ################################################### ### code chunk number 1: setup ################################################### options(width=84) library(BiocParallel); library(GenomicAlignments) ################################################### ### code chunk number 2: registered ################################################### registered() ################################################### ### code chunk number 3: Multicore ################################################### bpworkers() MulticoreParam() ################################################### ### code chunk number 4: Snow ################################################### SnowParam(workers = 4, type = "PSOCK") SnowParam(workers = 4, type = "MPI") ################################################### ### code chunk number 5: BatchJobs ################################################### BatchJobsParam(workers = 4, resources = list(ncpus=1)) ################################################### ### code chunk number 6: oversubscribe ################################################### workers <- c(bpworkers(), bpworkers() + 5, bpworkers() + 10) FUN <- function(i) system.time(bplapply(1:1000, sqrt, BPPARAM = MulticoreParam(i))) do.call(rbind, lapply(workers, FUN)) ################################################### ### code chunk number 7: s3_url (eval = FALSE) ################################################### ## bucketname <- "1000genomes" ## key <- "data/HG00096/alignment/ ## HG00096.chrom20.ILLUMINA.bwa.GBR.low_coverage.20120522.bam" ## url <- paste0("http://s3.amazonaws.com/", bucketname, "/", key) ################################################### ### code chunk number 8: FUN3 ################################################### FUN3 <- function(chrom, files, WL, group, ...) { library(cn.mops) counts <- getReadCountsFromBAM(files, WL = WL, mode = "unpaired", refSeqName = chrom, parallel = length(files)) referencecn.mops(cases = counts[,group == "tumor"], controls = counts[,group == "normal"]) }