adjustBoundary {mosaics} | R Documentation

## Adjust boundaries of peak regions

### Description

Adjust boundaries of peak regions in the `MosaicsPeak` class object, which is a peak calling result.

### Usage

    adjustBoundary( object, ... )
    ## S4 method for signature 'MosaicsPeak'
    adjustBoundary( object, minRead=10, extendFromSummit=100,
        trimMinRead1=1.5, trimFC1=5, extendMinRead1=2, extendFC1=50,
        trimMinRead2=1.5, trimFC2=50, extendMinRead2=1.5, extendFC2=50,
        normC=NA, parallel=FALSE, nCore=8 )

### Arguments

`object` | Object of class `MosaicsPeak`, a peak list object obtained using either functions `mosaicsPeak` or `mosaicsPeakHMM`.
`minRead` | Parameter to determine baseline for trimming and extension of peak boundaries.
`extendFromSummit` | If the updated peak regions do not include the peak summit, either peak start or end is extended by `extendFromSummit`.
`trimMinRead1` | Parameter to determine to trim peak boundaries.
`trimFC1` | Parameter to determine to trim peak boundaries.
`extendMinRead1` | Parameter to determine to extend peak boundaries.
`extendFC1` | Parameter to determine to extend peak boundaries.
`trimMinRead2` | Parameter used to trim peak boundaries.
`trimFC2` | Parameter used to trim peak boundaries.
`extendMinRead2` | Parameter used to extend peak boundaries.
`extendFC2` | Parameter used to extend peak boundaries.
`normC` | Normalizing constant. If not provided, `normC` is estimated as ratio of sequencing depth of ChIP over matched control samples.
`parallel` | Utilize multiple CPUs for parallel computing using `"parallel"` package? Possible values are `TRUE` (utilize multiple CPUs) or `FALSE` (do not utilize multiple CPUs). Default is `FALSE` (do not utilize multiple CPUs).
`nCore` | Number of CPUs when parallel computing is utilized.
`...` | Other parameters to be passed through to generic `mosaicsHMM`.

### Details

`adjustBoundary` adjusts peak boundaries. While `adjustBoundary` can be applied to a peak list object obtained using either functions `mosaicsPeak` or `mosaicsPeakHMM`, `adjustBoundary` is developed and tested mainly for peak lists from MOSAiCS-HMM model (i.e., from function `mosaicsPeakHMM`). Note that `extractReads` should be run first because `adjustBoundary` is used.

Parallel computing can be utilized for faster computing if `parallel=TRUE` and `parallel` package is loaded. `nCore` determines number of CPUs used for parallel computing.

### Value

Construct `MosaicsPeak` class object.

### Author(s)

Dongjun Chung, Pei Fen Kuan, Rene Welch, Sunduz Keles

### References

Kuan, PF, D Chung, G Pan, JA Thomson, R Stewart, and S Keles (2011), "A Statistical Framework for the Analysis of ChIP-Seq Data", Journal of the American Statistical Association, Vol. 106, pp. 891-903.

Chung, D, Zhang Q, and Keles S (2014), "MOSAiCS-HMM: A model-based approach for detecting regions of histone modifications from ChIP-seq data", Datta S and Nettleton D (eds.), Statistical Analysis of Next Generation Sequencing Data, Springer.

### See Also

`mosaicsPeak`, `mosaicsPeakHMM`, `extractReads`, `findSummit`, `filterPeak`, `MosaicsPeak`.

### Examples

    ## Not run:
    library(mosaicsExample)

    constructBins( infile=system.file( file.path("extdata","wgEncodeBroadHistoneGm12878H3k4me3StdAlnRep1_chr22_sorted.bam"), package="mosaicsExample"),
        fileFormat="bam", outfileLoc="./",
        byChr=FALSE, useChrfile=FALSE, chrfile=NULL, excludeChr=NULL,
        PET=FALSE, fragLen=200, binSize=200, capping=0 )
    constructBins( infile=system.file( file.path("extdata","wgEncodeBroadHistoneGm12878ControlStdAlnRep1_chr22_sorted.bam"), package="mosaicsExample"),
        fileFormat="bam", outfileLoc="./",
        byChr=FALSE, useChrfile=FALSE, chrfile=NULL, excludeChr=NULL,
        PET=FALSE, fragLen=200, binSize=200, capping=0 )

    binHM <- readBins( type=c("chip","input"),
        fileName=c( "./wgEncodeBroadHistoneGm12878H3k4me3StdAlnRep1_chr22_sorted.bam_fragL200_bin200.txt",
        "./wgEncodeBroadHistoneGm12878ControlStdAlnRep1_chr22_sorted.bam_fragL200_bin200.txt" ) )
    fitHM <- mosaicsFit( binHM, analysisType="IO", bgEst="rMOM" )
    hmmHM <- mosaicsFitHMM( fitHM, signalModel = "2S",
      init="mosaics", init.FDR = 0.05, parallel=TRUE, nCore=8 )
    peakHM <- mosaicsPeakHMM( hmmHM, FDR = 0.05, decoding="posterior",
      thres=10, parallel=TRUE, nCore=8 )

    peakHM <- extractReads( peakHM,
      chipFile=system.file( file.path("extdata","wgEncodeBroadHistoneGm12878H3k4me3StdAlnRep1_chr22_sorted.bam"), package="mosaicsExample"),
      chipFileFormat="bam", chipPET=FALSE, chipFragLen=200,
      controlFile=system.file( file.path("extdata","wgEncodeBroadHistoneGm12878ControlStdAlnRep1_chr22_sorted.bam"), package="mosaicsExample"),
      controlFileFormat="bam", controlPET=FALSE, controlFragLen=200, parallel=TRUE, nCore=8 )
    peakHM <- findSummit( peakHM, parallel=TRUE, nCore=8 )
    peakHM <- adjustBoundary( peakHM, parallel=TRUE, nCore=8 )
    peakHM <- filterPeak( peakHM, parallel=TRUE, nCore=8 )

    ## End(Not run)

[Package mosaics version 2.24.0 Index]