geneNames {ballgown} | R Documentation

## get gene names from a ballgown object

### Description

get gene names from a ballgown object

### Usage

    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

    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)

[Package ballgown version 2.18.0 Index]