Gviz - adding ensembl gene annotation track
2
0
Entering edit mode
just • 0
@just-9837
Last seen 7.1 years ago

Hey guys,

I'm trying to plot genomic locus of interest. I'd be particularly interested in protein-coding genes. I've thought about loading Ensembl track using

ensGenes2 <- UcscTrack(genome = "hg19", chromosome = "chr19",
                      track = "ensGene", from = start, to = end, trackType = "GeneRegionTrack",
                      rstarts = "exonStarts", rends = "exonEnds", gene = "name",
                      symbol = "name", transcript = "name", strand = "strand",
                      fill = "#960000", name = "Ensembl Genes", showId=T, geneSymbol=T)

 

Somehow my feeling is that what I'm getting are also non-coding transcripts. Do you know how I can change it (to focus only on the coding ones)?

Another issue would be the symbols in the graph. Is there anyway that gviz can plot symbols like in the HUGO format?

I'd be really grateful for you help!

gviz ensembl • 1.8k views
ADD COMMENT
0
Entering edit mode
Johannes Rainer ★ 2.0k
@johannes-rainer-6987
Last seen 21 days ago
Italy

You could use the ensembldb package to create a GeneRegionTrack containing only protein coding genes:

library(Gviz)
library(EnsDb.Hsapiens.v75)
edb <- EnsDb.Hsapiens.v75

Then generate a GRanges object for Gviz:

gr <- getGeneRegionTrackForGviz(edb, filter = list(GenebiotypeFilter("protein_coding"), SeqnameFilter("Y")))
gat <- GenomeAxisTrack()
## We have to change the ucscChromosomeNames option to FALSE to enable Gviz usage
## with non-UCSC chromosome names.
options(ucscChromosomeNames = FALSE)
plotTracks(list(gat, GeneRegionTrack(gr)))

 

You could have a look at the ensembldb vignette for more details how to use filters to retrieve just the data you want.

ADD COMMENT
0
Entering edit mode
just • 0
@just-9837
Last seen 7.1 years ago

Thank you for your help, guys! 

This is what worked for me in the end:

library(Gviz)
library(EnsDb.Hsapiens.v75)
edb <- EnsDb.Hsapiens.v75

gr <- getGeneRegionTrackForGviz(edb, filter = GenebiotypeFilter("protein_coding"), chromosome="chr19", start=start,
                                end=end)

options(ucscChromosomeNames = FALSE)
plotTracks(list(axTrack, GeneRegionTrack(gr)), showId=T)

 

ADD COMMENT

Login before adding your answer.

Traffic: 693 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