PeakSegDP: PeakSegDP

Description Usage Arguments Author(s) Examples

Description

Compute the PeakSeg model on a data.frame of compressed sequence reads.

Usage

1
PeakSegDP(compressed, maxPeaks)

Arguments

compressed

data.frame with columns chromStart, chromEnd, count.

maxPeaks

maximum number of peaks to consider.

Author(s)

Toby Dylan Hocking, Guillem Rigaill

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
library(PeakSegDP)
data(chr11ChIPseq, envir=environment())
one <- subset(chr11ChIPseq$coverage, sample.id=="McGill0002")[10000:12000,]
fit <- PeakSegDP(one, 3L)

if(interactive() && require(ggplot2)){

  ggplot()+
    geom_step(aes(chromStart/1e3, count), data=one)+
    geom_segment(aes(chromStart/1e3, mean,
                     xend=chromEnd/1e3, yend=mean),
                 data=fit$segments, color="green")+
    geom_segment(aes(chromStart/1e3, 0,
                     xend=chromEnd/1e3, yend=0),
                 data=subset(fit$segments, status=="peak"),
                 size=3, color="deepskyblue")+
    theme_bw()+
    theme(panel.margin=grid::unit(0, "cm"))+
    facet_grid(peaks ~ ., scales="free", labeller=function(df){
      s <- ifelse(df$peaks==1, "", "s")
      df$peaks <- paste0(df$peaks, " peak", s)
      df
    })

}

PeakSegDP documentation built on Aug. 16, 2017, 1:02 a.m.