
getWidths(data)
SummarizedExperiment
object, produced by windowCounts
or regionCounts
The fragment length is taken from exptData(data)$final.ext
, if it is not NA
.
Otherwise, it is taken from data$ext
.
For paired-end data, the average fragment length should be the median of the values obtained with getPESizes
.
If the fragment lengths are different between libraries, the average is used to computed the effective width of the window.
If final.ext
is NA
and any of ext
are NA
, the function will throw an error.
Users should set the read length in data$rlen
to avoid this, as NA
values of ext
correspond to the use of unextended reads.
windowCounts
,
regionCounts
bamFiles <- system.file("exdata", c("rep1.bam", "rep2.bam"), package="csaw")
data <- windowCounts(bamFiles, filter=1)
getWidths(data)
data <- windowCounts(bamFiles, ext=c(50, 100), filter=1)
getWidths(data)
data <- windowCounts(bamFiles, ext=makeExtVector(c(50, 100)), filter=1)
getWidths(data)
# Avoid error by defining 'rlen'.
data <- windowCounts(bamFiles, ext=c(NA, 100), filter=1)
try(getWidths(data))
data$rlen <- 200
getWidths(data)
# Paired-end data takes the fragment length from 'ext'.
bamFile <- system.file("exdata", "pet.bam", package="csaw")
data <- windowCounts(bamFile, param=readParam(pe="both"), ext=200, filter=1)
getWidths(data)
Run the code above in your browser using DataLab