UnzipAndMergeBed {enrichTF} | R Documentation

## Unzip all zipped BED files and merge them into one BED file

### Description

This function process region BED files in three step: First, unzip the gzip and bzip2 BED input files. Second, select first 3 columns of the BED files. Third, merge the BED files into one BED.

### Usage

    enrichUnzipAndMergeBed(prevStep, bedInput = NULL, bedOutput = NULL, ...)

    ## S4 method for signature 'Step'
    enrichUnzipAndMergeBed(prevStep, bedInput = NULL, bedOutput = NULL, ...)

    unzipAndMergeBed(bedInput, bedOutput = NULL, ...)

### Arguments

`prevStep` | `Step-class` object scalar. It needs to be the return value of upstream process from other packages, such as ATAC-seq peak calling result from esATAC.
`bedInput` | `Character` scalar or vector. The directory of region BED files for analysis. BED, BED.gz, BED.bz2 formats are supported.
`bedOutput` | `Character` scalar. The BED output file directory of merged BED files. Default: NULL (generated base on first BED file in bedInput)
`...` | Additional arguments, currently unused.

### Details

All compressed files will be de-compressed. Only first 3 columns (chromasomes, start and end) will be collected. All BED files will be merged into one BED file.

### Value

An invisible `EnrichStep-class` object (inherit from `Step-class`) scalar for downstream analysis.

### Author(s)

Zheng Wei

### See Also

`genBackground`

### Examples

    foregroundBedPath <- system.file(package = "enrichTF", "extdata","testregion.bed.gz")
    gen <- unzipAndMergeBed(bedInput = foregroundBedPath)

[Package enrichTF version 1.10.0 Index]