datadir <- system.file('extdata', 'genomeData', package='derfinder')
files <- rawFiles(datadir=datadir, samplepatt='*accepted_hits.bam$',
fileterm=NULL)
## Shorten the column names
names(files) <- gsub('_accepted_hits.bam', '', names(files))
## Read and filter the data, only for 1 file
fullCov <- fullCoverage(files=files[1], chrs=c('21', '22'))
fullCov
## You can then use filterData() to filter the data if you want to.
## Use bplapply() if you want to do so with multiple cores as shown below.
library('BiocParallel')
p <- SnowParam(2L, outfile = Sys.getenv('SGE_STDERR_PATH'))
bplapply(fullCov, function(x) {
library('derfinder'); filterData(x, cutoff=0) }, BPPARAM = p)
Run the code above in your browser using DataLab