read in gtf file as GRanges object

Share:

Description

(very) light wrapper for rtracklayer::import

Usage

1
2
gffReadGR(gtf, splitByTranscript = FALSE, identifier = "transcript_id",
  sep = "; ")

Arguments

gtf

name of GTF/GFF file on disk

splitByTranscript

if TRUE, return a GRangesList of transcripts; otherwise return a GRanges object containing all genomic features in gtf. Default FALSE.

identifier

name of transcript identifier column of attributes field in gtf. Default "transcript_id". Only used if splitByTranscript is TRUE.

sep

field separator in the attributes field of gtf. Default "; " (semicolon + space). Only used if splitByTranscript is TRUE.

Value

if splitByTranscript is FALSE, an object of class GRanges representing the genomic features in gtf. If splitByTranscript is TRUE, an object of class GRangesList, where each element is a GRanges object corresponding to an annotated transcript (designated in names).

Author(s)

Alyssa Frazee

See Also

gffRead for reading in a GTF file as a data frame rather than a GRanges/GRangesList object.

Examples

1
2
3
4
5
6
7
gtfPath = system.file('extdata', 'annot.gtf.gz', package='ballgown')

# read in exons as GRanges:
annotgr = gffReadGR(gtfPath)

# read in groups of exons as transcripts, in GRangesList:
transcripts_grl = gffReadGR(gtfPath, splitByTranscript=TRUE)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.