plotPeaks: Create a plot of ChIP read counts with called peaks and...

Description Usage Arguments Value Author(s) References Examples

View source: R/plotPeaks.R

Description

'plotPeaks()' imports the output from 'mixHMM()' and plots the peak calls of a given genomic region.

Usage

1
plotPeaks(output, ranges, ChIP, group, offset = NULL, peaks = NULL)

Arguments

output

An output from 'mixHMM()'

ranges

A vector with two elements that specifies the genomic windows to be plotted.

ChIP

M*N matrix of ChIP read counts, where M is the number of windows in the analyzed genome and N is the number of conditions*replicates

group

vector of length N with condition labels (e.g. c(1,1,2,2,3,3) for three conditions and two replicates each)

offset

M*N matrix of offsets (default is offset = matrix(0,nrow=M,ncol=N))

peaks

An optional vector of length M with zeros (background), ones (differential peaks), and twos (consensus peaks) representing the enriched windows. If not provided, 'plotPeaks()' will use the Viterbi sequence from 'output'.

Value

A ggplot

Author(s)

Pedro L. Baldoni, pedrobaldoni@gmail.com

References

https://github.com/plbaldoni/mixHMM

Examples

1
2
3
4
5
6
7
8
9
data(H3K36me3)
ChIP = SummarizedExperiment::assay(H3K36me3)
offset = ZIMHMM::createOffset(ChIP,method = 'loess',span = 1)
group = c(1,1,1,2,2,2,3,3,3)
B = 2^(length(unique(group)))-2
## Not run: output = mixHMMConstr(ChIP,Control=NULL,offset,group,B,control = controlPeaks(epsilon.em = rep(1e-6,4)))
## Not run: plotPeaks(output = test,ranges = c(which.min(abs(start(rowRanges(H3K36me3))-17800000)),
which.min(abs(end(rowRanges(H3K36me3))-18150000))),ChIP = ChIP,group = group,offset = offset)
## End(Not run)

plbaldoni/mixHMM documentation built on Nov. 8, 2019, 8:05 p.m.