as_granges: Convert data.table to GRanges object

Description Usage Arguments Value See Also Examples

Description

Convert gtf, gff, bed, bam or a valid data.table to a GRanges object.

Usage

1
as_granges(x, ignore_strand = FALSE)

Arguments

x

An object of class gtf, gff, bed or bam or a valid data.table object.

ignore_strand

Logical argument to pass to GRanges function. Indicates whether strand should be ignored when constructing GRanges object or not. Default is FALSE.

Value

A GRanges object.

See Also

read_format extract construct_introns

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
path <- system.file("tests", package="gread")
gff_file <- file.path(path, "sample.gff")
gtf_file <- file.path(path, "sample.gtf")
bed_file <- file.path(path, "sample.bed")
bam_file <- file.path(path, "sample.bam")

gff <- read_format(gff_file)
gtf <- read_format(gtf_file)
bed <- read_format(bed_file)
bam <- read_format(bam_file)

as_granges(gff)
as_granges(gtf)
as_granges(bed)
as_granges(bam)

as_granges(gff, ignore_strand=FALSE)
as_granges(gtf, ignore_strand=FALSE)
as_granges(bed, ignore_strand=FALSE)
as_granges(bam, ignore_strand=FALSE)

## End(Not run)

openanalytics/gread documentation built on May 24, 2019, 2:29 p.m.