PeaksToNarrowPeak {MACPET} | R Documentation

## Convert Peaks to narrowPeak (BED) object.

### Description

`PeaksToNarrowPeak` converts peaks of an object of `PSFit` class to `narrowPeak` object. The object is saved in a user specified directory and can be used in the MANGO or MICC algorithms for interaction analysis. Alternatively, the user can run stage 4 at `MACPETUlt`.

### Usage

    PeaksToNarrowPeak(object, ...)

    ## Default S3 method:
    PeaksToNarrowPeak(object, ...)

    ## S3 method for class 'PSFit'
    PeaksToNarrowPeak(object, threshold = NULL, savedir,
      file.out, ...)

### Arguments

`object` | An object of class `PSFit`.
`...` | Further arguments to be passed to `PeaksToNarrowPeak` (not used).
`threshold` | A numeric with the FDR cut-off threshold used to take a subset of significant peaks. If `threshold=NULL` then all the peaks are returned.
`savedir` | A string with the directory to save the ouput file.
`file.out` | A string with the name of the output to be saved to `savedir`.

### Details

Each Peak in the narrowPeak object is represented by an interval starting from the 'CIQ.Up.start' estimated variable to its 'CIQ.Down.end' (see `PSFit`). Close Peaks in genomic distance are NOT merged by the `PeaksToNarrowPeak` function. However the user can specify a distance window for merging in the MANGO or MICC algorithms. Note also that MANGO and MICC find a self-ligated cut-off by itself which is usually very different than that found by MACPET. We suggest that the user overwrites MANGOS's or MICC's cut-off with that of MACPET.

### Value

A `narrowPeak` object named after the value of `file.out` and saved in the `savedir.`

### Author(s)

Ioannis Vardaxis, ioannis.vardaxis@ntnu.no

### References

Vardaxis I, Drabløs F, Rye M and Lindqvist BH (2018). MACPET: Model-based Analysis for ChIA-PET. To be published.

### See Also

`PSFit`

### Examples

    #Create a temporary forder, or anywhere you want:
    savedir=file.path(tempdir(),'MACPETtest')
    dir.create(savedir)#where you will save the results
    file.out='MACPET_peaks.narrowPeak'

    #load Self-ligated data: (class=PSFit)
    load(system.file('extdata', 'MACPET_psfitData.rda', package = 'MACPET'))
    class(MACPET_psfitData)
    PeaksToNarrowPeak(object=MACPET_psfitData,threshold=1e-5,file.out=file.out,savedir=savedir)

    #-----delete test directory:
    unlink(savedir,recursive=TRUE)

[Package MACPET version 1.4.0 Index]