plotCounts: Create a plot with the results from epigraHMM

View source: R/plotCounts.R

plotCountsR Documentation

Create a plot with the results from epigraHMM

Description

'plotCounts()' plots read counts and peak regions from 'epigraHMM()'

Usage

plotCounts(
  object,
  ranges,
  hdf5 = metadata(object)$output,
  peaks = NULL,
  annotation = NULL
)

Arguments

object

an epigraHMMDataSet

ranges

a GRanges object or a pair of integers with the genomic corrdinates/windows to be plotted

hdf5

an optional character string with the hdf5 file path from 'epigraHMM'

peaks

an optional parameter with a GRanges object or a vector of logicals (with length equal to the number of rows in 'object') specifying the genomic corrdinates/windows with peaks

annotation

an optional parameter with a GRanges object or a vector of logicals (with length equal to the number of rows in 'object') specifying the genomic corrdinates/windows of an annotation track

Details

If the input object contains the assay 'offset', reads will be normalized prior to plotting (e.g. counts/exp(offset)). Reads from replicates pertaining to the same condition are aggregated prior to plotting.

Value

A ggplot

Author(s)

Pedro L. Baldoni, pedrobaldoni@gmail.com

References

https://github.com/plbaldoni/epigraHMM

Examples


countData <- rbind(matrix(rnbinom(1e3,mu = 2,size = 10),ncol = 1),
                   matrix(rnbinom(1e3,mu = 7.5,size = 5),ncol = 1),
                   matrix(rnbinom(1e3,mu = 7.5,size = 5),ncol = 1),
                   matrix(rnbinom(1e3,mu = 2,size = 10),ncol = 1))

colData <- data.frame(condition = 'A', replicate = 1)

object <- epigraHMMDataSetFromMatrix(countData,colData)

plotCounts(object,ranges = c(500,3500))


plbaldoni/epigrahmm documentation built on Oct. 14, 2023, 5:13 a.m.