gffReadGR {ballgown} | R Documentation

## read in gtf file as GRanges object

### Description

(very) light wrapper for rtracklayer::import

### Usage

    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

    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)

[Package ballgown version 2.18.0 Index]