How to display gene symbols in UCSC Track in Gviz
1
0
Entering edit mode
Greg G. • 0
@greg-g-12314
Last seen 7.4 years ago
USA/Seattle

Hello everyone,

I am trying to get Gviz::UcscTrack to display HGNC symbols, or at least the default name from the gene() function. The piece of code I am using is pasted below. Any help is highly appreciated.

 

ucscGenes <- UcscTrack(genome="hg38", table="ncbiRefSeq", track = 'NCBI RefSeq', trackType="GeneRegionTrack", 
                                   chromosome="chr19", rstarts = "exonStarts", rends = "exonEnds", 
                                   gene = "name", symbol = 'name', transcript = "name", 
                                   strand = "strand", stacking = 'pack', showID = T, geneSymbol = T)

 

Thank you

 

gviz ucsctrack hgnc • 4.6k views
ADD COMMENT
1
Entering edit mode
@james-w-macdonald-5106
Last seen 2 days ago
United States

The UCSC tables in general don't have the HUGO symbols, so you end up having to add those yourself. But it's really easy to do.

> ucscGenes <- UcscTrack(genome="hg38", table="ncbiRefSeq", track = 'NCBI RefSeq', trackType="GeneRegionTrack",
                                   chromosome="chr19", rstarts = "exonStarts", rends = "exonEnds",
                                   gene = "name", symbol = 'name', transcript = "name",
                                   strand = "strand", stacking = 'pack', showID = T, geneSymbol = T)

> z <- ranges(ucscGenes)

> library(org.Hs.eg.db)

> mcols(z)$symbol <- mapIds(org.Hs.eg.db, gsub("\\.[1-9]$", "", mcols(z)$symbol), "SYMBOL","REFSEQ")
> ucscGenes2 <- ucscGenes
> ranges(ucscGenes2) <- z

> plotTracks(list(ucscGenes, ucscGenes2), chromosome = "chr19", from = 1e6, to = 1.4e6, transcriptAnnotation = "symbol")
ADD COMMENT
0
Entering edit mode

Fantastic! It worked like a charm. I suppose with the mapping method I can assign any form of nomenclature to the genes. Right?

Thanks,
Greg

ADD REPLY
0
Entering edit mode

I don't know what you mean by 'with the mapping method I can assign any form of nomenclature to the genes'. Can you clarify?

ADD REPLY
0
Entering edit mode

It's OK. I meant the mapIds() function. Thanks again.

ADD REPLY

Login before adding your answer.

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