plotFragLength {ggbio} | R Documentation |
Plot estimated fragment length for paired-end RNA-seq data against single reduced data model.
## S4 method for signature 'character,GRanges' plotFragLength(data, model, gap.ratio = 0.0025, geom = c("segment", "point", "line"), type = c("normal", "cut"), heights = c(400, 100), annotation = TRUE)
data |
A character indicate the bam file. |
model |
A reduced model to compute estimated fragment length. please see details. |
gap.ratio |
When type is set to "cut", it will provide a compact view, which cut the common gaps in a certain ratio. |
geom |
One or all three geoms could be drawn at the same time. y value of "point" and "line" indicate the estimated fragment length. and if geom is set to "segment", the segment is from the left most position to paired right most position, should be equal to "isize". |
type |
"normal" return a uncut view, loose but the coordinate is true genomic coordinates. "cut" cut the view in a compact way. |
heights |
Numeric vector indicate the heights of tracks. |
annotation |
A logical value. TRUE shows model, and FALSE shows only fragment length with labels. |
We use a easy way to define this estimated fragment length, we collect all paired reads and model, reduce model first, then find common gaps, remove common gaps between paired-end reads, and compute the new estimated fragment length.
A ggplot object when annotation = FALSE
and a frame grob if
annotation = TRUE
Tengfei Yin
## Not run:
##D data(genesymbol)
##D bamfile <- system.file("extdata", "SRR027894subRBM17.bam", package="biovizBase")
##D library(TxDb.Hsapiens.UCSC.hg19.knownGene)
##D txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
##D model <- exonsBy(txdb, by = "tx")
##D model.new <- subsetByOverlaps(model, genesymbol["RBM17"])
##D exons.rbm17 <- subsetByOverlaps(exons(txdb), genesymbol["RBM17"])
##D exons.new <- reduce(exons.rbm17)
##D plotFragLength(bamfile, exons.new, geom = "line")
##D plotFragLength(bamfile, exons.new, geom = c("point","segment"))
##D plotFragLength(bamfile, exons.new, geom = c("point","segment"), annotation = FALSE)
##D plotFragLength(bamfile, exons.new, geom = c("point","segment"), type = "cut",
##D gap.ratio = 0.001)
## End(Not run)