## BigWig files are not supported in Windows
if(.Platform$OS.type != 'windows') {
## Get data
library('derfinderData')
## Identify sample files
sampleFiles <- rawFiles(system.file('extdata', 'AMY', package =
'derfinderData'), samplepatt = 'bw', fileterm = NULL)
names(sampleFiles) <- gsub('.bw', '', names(sampleFiles))
## Create the mean bigwig file. This file is normally created by Rail
## but in this example we'll create it manually.
library('GenomicRanges')
fullCov <- fullCoverage(files = sampleFiles, chrs = 'chr21')
meanCov <- Reduce('+', fullCov$chr21) / ncol(fullCov$chr21)
createBw(list('chr21' = DataFrame('meanChr21' = meanCov)), keepGR =
FALSE)
summaryFile <- 'meanChr21.bw'
## Get the regions
regionMat <- railMatrix(chrs = 'chr21', summaryFiles = summaryFile,
sampleFiles = sampleFiles, L = 76, cutoff = 5, maxClusterGap = 3000L)
## Explore results
names(regionMat$chr21)
regionMat$chr21$regions
dim(regionMat$chr21$coverageMatrix)
}
Run the code above in your browser using DataLab