geneNames: get gene names from a ballgown object

Description Usage Arguments Details Value See Also Examples

Description

get gene names from a ballgown object

Usage

1
2
3
4
geneNames(x)

## S4 method for signature 'ballgown'
geneNames(x)

Arguments

x

a ballgown object

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.

Value

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

See Also

geneIDs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

alyssafrazee/ballgown-release documentation built on May 12, 2019, 1:40 a.m.