bam_to: Convert a BAM file

View source: R/bam_to.R

bam_toR Documentation

Convert a BAM file

Description

Convert a BAM file to any format supported by rtracklayer::export.

Usage

bam_to(
  bam_files,
  formats = c("bedGraph", "bigWig"),
  width = 150,
  outdir = NULL,
  verbose = TRUE,
  ...
)

Arguments

bam_files

One or more BAM files.

formats

A character vector of one or more formats for export file to.

width

If x is an IRanges, IPos or Views object: For narrow and threebands, a vector of integers, eventually with NAs. See the SEW (Start/End/Width) interface for the details (?solveUserSEW). For resize and flank, the width of the resized or flanking regions. Note that if both is TRUE, this is effectively doubled. Recycled as necessary so that each element corresponds to a range in x.

Can also be a list-like object parallel to x if x is a RangesList object.

outdir

Directory to save results to.

verbose

Print messages.

...

Arguments passed on to rtracklayer::export.bw

con

A path, URL or BigWigFile object. Connections are not supported. For the functions ending in .bw, the file format is indicated by the function name. For the export and import methods, the format must be indicated another way. If con is a path, or URL, either the file extension or the format argument needs to be “bigWig” or “bw”.

object

The object to export, should be an RleList, IntegerList, NumericList, GRanges or something coercible to a GRanges.

Value

Converted file paths.

Examples

bam_files <- c(f1=system.file("extdata","querybins.bam",package="Rsamtools"),
               f2=system.file("extdata","revbins.bam",package="Rsamtools"))
converted_files <- bam_to(bam_files = bam_files)               

neurogenomics/PeakyFinders documentation built on Oct. 14, 2024, 3:09 p.m.