Skip to contents

This function plots histograms of the various per-read summary statistics calculated by addReadStats.

Usage

plotReadStats(
  se,
  readInfoCol = "readInfo",
  qcCol = "QC",
  minQscore = 0,
  maxEntropy = Inf,
  maxFracLowConf = 1,
  minReadLength = 0,
  minAlignedLength = 0,
  minAlignedFraction = 0
)

Arguments

se

A RangedSummarizedExperiment, typically generated by addReadStats.

readInfoCol

A character scalar providing the name of the column in colData that contains read info. Can be NULL if no such column exists.

qcCol

A character scalar providing the name of the column in colData that contains quality metrics (calculated by calcReadStats). Can be NULL if no such column exists.

minQscore, maxEntropy, maxFracLowConf, minReadLength, minAlignedLength, minAlignedFraction

Numeric scalars representing possible threshold values used in filterReads, for illustration in the plot panels.

Value

A ggplot object.

Author

Panagiotis Papapasaikas, Charlotte Soneson, Michael Stadler

Examples

library(SummarizedExperiment)
modbamfiles <- system.file("extdata",
                           c("6mA_1_10reads.bam", "6mA_2_10reads.bam"),
                          package = "footprintR")
se <- readModBam(bamfile = modbamfiles, regions = "chr1:6940000-6955000",
                 modbase = "a", verbose = TRUE)
#>  extracting base modifications from modBAM files
#>  finding unique genomic positions...
#>  finding unique genomic positions... [43ms]
#> 
#>  collapsed 17739 positions to 7967 unique ones
#>  collapsed 17739 positions to 7967 unique ones [870ms]
#> 
se <- addReadStats(se)
plotReadStats(se)