exportPeaks {MACPET} | R Documentation

## Exports peaks to csv file

### Description

`exportPeaks` is an S3 method for the PSFit class. It exports peak information to a csv file in a given directory.

### Usage

    exportPeaks(object, ...)

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

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

    ## S4 method for signature 'PSFit'
    exportPeaks(object, file.out, savedir,
      threshold = NULL, ...)

### Arguments

`object` | An object of `PSFit` class.
`...` | (not used).
`file.out` | A string with the name of the output to be saved to `savedir`.
`savedir` | A string with the directory to save the output.
`threshold` | A numeric indicating the FDR cut-off used for subseting significant peaks. If NULL all the peaks are returned.

### Value

For `PSFit` class: a csv file named after the value of `file.out` with all the information about the peaks found by the `MACPETUlt` function, plus comments which explain the column names.

### 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

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

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

[Package MACPET version 1.10.0 Index]