In ggbio, plot transcripts from a TxDb with gene labels
1
0
Entering edit mode
grp2009 • 0
@grp2009-11057
Last seen 5.5 years ago

I am trying to change the labels in ggbio's autoplot output (specifically, when the input is a TxDb) so that the transcripts are labelled with the corresponding gene symbol. What I'm starting with is the following code:

library(ggbio)
library(GenomicRanges)
wh <- GRanges(seqnames='chr18',
        ranges=IRanges(start=11688900,end=11885700)
)
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
autoplot(txdb, which = wh)

The output is very nice, but the transcripts are labelled with transcript identifiers such as uc002kqh.3, etc.  I would like to replace these labels with gene symbols, but despite poring through the documentation I can see no way to do this. Any ideas?

ggbio • 1.6k views
ADD COMMENT
0
Entering edit mode
@michael-lawrence-3846
Last seen 3.0 years ago
United States

The TxDb objects do not contain gene symbols (go figure). You could use an OrganismDb object (e.g., from the Homo.sapiens package). Then ggbio will use gene symbols by default.

ADD COMMENT

Login before adding your answer.

Traffic: 828 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6