windows
can be a predefined region such as CpG islands
or gene bodies that are not necessarily equi-width. Each window will be chopped to
equal number of bins based on bin.num
option.ScoreMatrixBin(target, windows, bin.num = 10, bin.op = "mean",
strand.aware = FALSE, weight.col = NULL, is.noCovNA = FALSE,
type = "", rpm = FALSE, unique = FALSE, extend = 0, param = NULL,
bam.paired.end = FALSE, library.size = NULL)\S4method{ScoreMatrixBin}{RleList,GRanges}(target, windows, bin.num, bin.op,
strand.aware)
\S4method{ScoreMatrixBin}{GRanges,GRanges}(target,windows,bin.num,bin.op,
strand.aware,weight.col,is.noCovNA)
\S4method{ScoreMatrixBin}{character,GRanges}(target, windows, bin.num=10,
bin.op='mean',strand.aware, type,
rpm, unique, extend, param,
bam.paired.end=FALSE,
library.size=NULL)
RleList
, GRanges
, BAM file or a bigWig file
object to be overlapped with ranges in windows
GRanges
object that contains the windows of interest.
It could be promoters, CpG islands, exons, introns. However,
the sizes of windows does NOT have to be equal.integer
value denoting how many bins there
should be for each windowscoreMatrix
.
If the strand of a window is -, the values of the bins
for that window will be reversedGRanges
object a numeric column
in meta data part can be used as weights. This is particularly
useful when genomic regions have scores other than their
coverage values, such as percent methylation, conservation
scores, GC content, etc.library.size
.rpm
has to be set to TRUE).
If is not given (default: NULL) then library size
is calculated using the Rsamtools package functions:
sum(countBam(BamFile(target
))$records).scoreMatrix
objectScoreMatrix
data(cage)
data(cpgi)
data(promoters)
myMat=ScoreMatrixBin(target=cage,
windows=cpgi,bin.num=10,bin.op="mean",weight.col="tpm")
plot(colMeans(myMat,na.rm=TRUE),type="l")
myMat2=ScoreMatrixBin(target=cage,
windows=promoters,bin.num=10,bin.op="mean",
weight.col="tpm",strand.aware=TRUE)
plot(colMeans(myMat2,na.rm=TRUE),type="l")
Run the code above in your browser using DataLab