macs2gr {TransView} | R Documentation

## Convenience function for MACS output conversion

### Description

Parses the output of MACS Peak finding algorithm and returns a GRanges object compatible to the down stream functions of TransView

### Usage

    macs2gr(macs_peaks_xls, psize, amount="all", min_pileup=0, log10qval=0, log10pval=0, fenrichment=0, peak_mid="summit")

### Arguments

`macs_peaks_xls` | Full path to the file ending with ‘_peaks.xls’ located in the output folder of a MACS run.
`psize` | An integer setting the total length of the peaks. Setting psize to ‘preserve’ will keep the original peak lengths from the output file and override `peak_mid`. Note that this is not compatible with `plotTV`
`amount` | Amount of peaks returned. If an integer is provided, the returned peaks will be limited to this amount after sorting by pile up score.
`min_pileup` | Minimum pile up.
`log10qval` | Minimal log10 q-value
`log10pval` | Minimal log10 p-value
`fenrichment` | Minimal enrichment.
`peak_mid` | If set to ‘summit’, the peaks with length `psize` will centered on the peak summit. If set to ‘center’, the mid point of start and end will be used.

### Details

Convenience function parsing the output of a MACS file. Tested with MACS v1.4 and v.2.09

### Value

`GRanges` object with one row per peak and meta data score, enrichment and log10 pvalue.

### Author(s)

Julius Muller ju-mu@alumni.ethz.ch

### Examples

    exls<-dir(system.file("extdata", package="TransView"),full=TRUE,patt="xls$")

    peaks<-macs2gr(exls,psize=500)
    head(peaks)

[Package TransView version 1.26.1 Index]