Learn R Programming

ballgown (version 2.4.2)

getGenes: label assembled transcripts with gene names

Description

label assembled transcripts with gene names

Usage

getGenes(gtf, assembled, UCSC = TRUE, attribute = "gene_id")

Arguments

gtf
path to a GTF file containing locations of annotated transcripts
assembled
GRangesList object, with each set of ranges representing exons of an assembled transcript.
UCSC
set to TRUE if you're using a UCSC gtf file. (Requires some extra text processing).
attribute
set to attribute name in gtf that gives desired gene identifiers. Default "gene_id"; another commone one is "gene_name" (for the gene symbol).

Value

an IRanges CharacterList of the same length as assembled, providing the name(s) of the gene(s) that overlaps each transcript in assembled.

Details

chromosome labels in gtf and assembled should match. (i.e., you should provide the path to a gtf corrsponding to the same annotation you used when constructing assembled)

Examples

Run this code
data(bg)
gtfPath = system.file('extdata', 'annot.gtf.gz', package='ballgown')
geneoverlaps = getGenes(gtfPath, structure(bg)$trans, UCSC=FALSE)

Run the code above in your browser using DataLab