Search
Question: Gviz - adding ensembl gene annotation track
0
gravatar for just
15 months ago by
just0
just0 wrote:

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!

ADD COMMENTlink modified 15 months ago • written 15 months ago by just0
0
gravatar for Johannes Rainer
15 months ago by
Johannes Rainer1.0k
Italy
Johannes Rainer1.0k wrote:

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 COMMENTlink modified 15 months ago • written 15 months ago by Johannes Rainer1.0k
0
gravatar for just
15 months ago by
just0
just0 wrote:

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 COMMENTlink written 15 months ago by just0
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 2.2.0
Traffic: 192 users visited in the last hour