tests |
PeakSeg is a constrained maximum Poisson likelihood segmentation model described in ”PeakSeg: constrained optimal segmentation and supervised penalty learning for peak detection in count data” (source). We proposed a constrained Dynamic Programming Algorithm (cDPA) for computing a model that satisfies the PeakSeg constraints.
if(!require(devtools))install.packages("devtools")
devtools::install_github("tdhock/PeakSegDP")
There are two main functions for computing the constrained segmentation model:
- cDPA is a low-level interface to the C solver. Its inputs are N
weighted data points and S, the maximum number of segments. It
outputs a list with components named
loss
,ends
, andmean
(S x N matrices describing the solution). - PeakSegDP is a more user-friendly wrapper of the cDPA. Its input
parameter is P, the maximum number of peaks, which implies S =
P*2+1. Its input data type is a data.frame with columns
count
,chromStart
,chromEnd
. It outputs a list of data.frames,peaks
,error
,segments
,breaks
.
- As explained in our ICML paper, the cDPA is a quadratic time algorithm that is not guaranteed to find the global optimum. For a linear time algorithm that recovers the global optimum, use the coseg package.
- For supervised peak detection in ChIP-seq data sets with several samples, see our newer method, PeakSegJoint.