as_bam: convert 'GAlignments' object to 'data.table'

Description Usage Arguments Value Examples

Description

For internal use only. Converts a GAlignments object to bam object.

Usage

1
as_bam(x)

Arguments

x

A GAlignments object.

Value

An object of class bam that inherits from data.table.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
For internal use only
library(GenomicAlignments)
path <- system.file("tests", package="gread")
bam_file <- file.path(path, "sample.bam")

# with no metadata
bam <- GenomicAlignments::readGAlignments(bam_file)
gread:::as_bam(bam)

# with some metadata
bam <- as(as_granges(read_format(bam_file)), "GAlignments")
gread:::as_bam(bam)

## End(Not run)

asrinivasan-oa/gread documentation built on May 10, 2019, 2:04 p.m.