Question: In ggbio, plot transcripts from a TxDb with gene labels
0
gravatar for grp2009
2.5 years ago by
grp20090
grp20090 wrote:

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 • 661 views
ADD COMMENTlink modified 2.5 years ago by Michael Lawrence11k • written 2.5 years ago by grp20090
Answer: In ggbio, plot transcripts from a TxDb with gene labels
0
gravatar for Michael Lawrence
2.5 years ago by
United States
Michael Lawrence11k wrote:

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 COMMENTlink written 2.5 years ago by Michael Lawrence11k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 237 users visited in the last hour