Learn R Programming

ballgown (version 2.4.2)

geneNames: get gene names from a ballgown object

Description

get gene names from a ballgown object

Usage

geneNames(x)
"geneNames"(x)

Arguments

x
a ballgown object

Value

named vector of gene names included in the ballgown object, named and ordered by corresponding numeric transcript ID.

Details

This vector differs from that produced by geneIDs in that geneNames produces *annotated* gene names that correspond to assembled transcripts. The return will be empty/blank/NA if the transcriptome assembly is de novo (i.e., was not compared to an annotation before the ballgown object was created). See getGenes for matching transcripts to gene names. Some entries of this vector will be empty/blank/NA if the corresponding transcript did not overlap any annotated genes.

See Also

geneIDs

Examples

Run this code
data(bg)
# this is a de novo assembly, so it does not contain gene info as it stands
# but we can add it:
annot = system.file('extdata', 'annot.gtf.gz', package='ballgown')
gnames = getGenes(annot, structure(bg)$trans, UCSC=FALSE)
gnames_first = lapply(gnames, function(x) x[1]) #just take 1 overlapping gene
expr(bg)$trans$gene_name = gnames_first

# now we can extract these gene names:
geneNames(bg)

Run the code above in your browser using DataLab