BamToBed {esATAC} | R Documentation

## Convert bam format to bed format.

### Description

This function convert a bam file into a bed file. Note:bed file is 0-based.

### Usage

    atacBam2Bed(atacProc, bamInput = NULL, bedOutput = NULL, ...)

    ## S4 method for signature 'ATACProc'
    atacBam2Bed(atacProc, bamInput = NULL,
      bedOutput = NULL, ...)

    bam2bed(bamInput, bedOutput = NULL, ...)

### Arguments

`atacProc` | `ATACProc-class` object scalar. It has to be the return value of upstream process: `atacBamSort`, `atacSam2Bam`.
`bamInput` | `Character` scalar. Bam file input path.
`bedOutput` | `Character` scalar. Bed file output path. If ignored, bed file will be put in the same path as the bam file.
`...` | Additional arguments, currently unused.

### Details

The bam file wiil be automatically obtained from object(`atacProc`) or input by hand. Output can be ignored.

### Value

An invisible `ATACProc-class` object scalar for downstream analysis.

### Author(s)

Wei Zhang

### See Also

`atacBamSort` `atacSam2Bam`

### Examples

    library(Rsamtools)
    ex1_file <- system.file("extdata", "ex1.bam", package="Rsamtools")
    bam2bed(bamInput = ex1_file)

[Package esATAC version 1.2.3 Index]