Usage
ScoreMatrix(target, windows, 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{ScoreMatrix}{RleList,GRanges}(target,windows,strand.aware)
\S4method{ScoreMatrix}{GRanges,GRanges}(target, windows, strand.aware,
weight.col, is.noCovNA)
\S4method{ScoreMatrix}{character,GRanges}(target, windows, strand.aware,
type='', rpm=FALSE,
unique=FALSE, extend=0, param=NULL,
bam.paired.end=FALSE,
library.size=NULL)
Arguments
target
RleList
, GRanges
, a BAM file or a BigWig
to be overlapped with ranges in windows
windows
GRanges
object that contains the windows of interest.
It could be promoters, CpG islands, exons, introns.
However the sizes of windows have to be equal.
strand.aware
If TRUE (default: FALSE), the strands of the
windows will be taken into account in the resulting
ScoreMatrix
.
If the strand of a window is -, the values of the bins
for that window will be reversed
weight.col
if the object is GRanges
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.
is.noCovNA
(Default:FALSE)
if TRUE,and if 'target' is a GRanges object with 'weight.col'
provided, the bases that are uncovered will be preserved as
NA in the returned object. This useful for situations where
you can not have coverage all over the genome, such as CpG
methylation values.
type
if target is a character vector of file paths, then type designates
the type of the corresponding files (bam or bigWig)
rpm
boolean telling whether to normalize the coverage to per milion
reads. FALSE by default. See library.size
.
unique
boolean which tells the function to remove duplicated reads
based on chr, start, end and strand
extend
numeric which tells the function to extend the reads to width=extend
bam.paired.end
boolean indicating whether given BAM file contains
paired-end reads (default:FALSE).
Paired-reads will be treated as fragments.
library.size
numeric indicating total number of mapped reads in a BAM file
(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).