Gviz UCSC tracks not visible
1
0
Entering edit mode
s.koturan • 0
@skoturan-22197
Last seen 4.5 years ago

Hi there, I'm trying to generate a locus plot with the ideogram, gene track from UCSC, along with SNPs and other featured track in the hg19 version of the human genome.

Code:

library(Gviz) library(TxDb.Hsapiens.UCSC.hg19.knownGene) library(GenomicInteractions) library(rtracklayer)

from <- 61547834 to <- 61565833

knownGenes <- UcscTrack(genome = "hg19", chromosome = "chr11", track = "knownGene", from = from, to = to, trackType = "GeneRegionTrack",rstarts = "exonStarts", rends = "exonEnds", gene = "name", symbol = "name2", transcript = "name", strand = "strand",fill = "#960000", name = "Genes")

txdb_hg19 <- TxDb.Hsapiens.UCSC.hg19.knownGene

txTranscriptsv1 <- GeneRegionTrack(txdbhg19, genome="hg19", chromosome="chr11", showId=TRUE, geneSymbol=TRUE, name="UCSC")

library(org.Hs.eg.db)

symbols <- unlist(mapIds(org.Hs.eg.db, gene(txTranscripts_v1), "SYMBOL", "ENTREZID", multiVals = "first"))

symbol(txTranscriptsv1) <- symbols[gene(txTranscriptsv1)]

snpLocations <- UcscTrack(genome = "hg19", chromosome = "chr11", track = "snp151", from = from, to = to, trackType = "AnnotationTrack", start = "chromStart", end = "chromEnd", id = "name",feature = "func", strand = "strand", shape = "line",stacking = "dense", fill = "black", name = "SNPs")

enh <- UcscTrack(genome = "hg19", chromosome = "chr11", track = "vistaEnhancers", from = from, to = to, trackType = "AnnotationTrack", start = "chromStart", end = "chromEnd", id = "name",feature = "func", strand = "strand", shape = "line", fill = "black", name = "Enhancer")

plotTracks(list(ideogram.track, genome.axis.track, txTranscripts_v1, snpLocations, enh), from = from, to = to, showTitle = TRUE)

But when I look at the plot, I don't see any SNPs or Enhancers marked in the region. What am I doing wrong?

Gviz R UCSC Tracks genome locusplot • 1.0k views
ADD COMMENT
1
Entering edit mode
Robert Ivanek ▴ 730
@robert-ivanek-5892
Last seen 4 months ago
Switzerland

Hi,

There were several issues in your code, you need to pay attention to extract correct information from UCSC tables. You also did not provide code which works. There were some parts missing and few typos. Here is the code which works for me.

Best Robert

library(rtracklayer)
library(Gviz)
library(GenomicInteractions)
library(org.Hs.eg.db)
library(TxDb.Hsapiens.UCSC.hg19.knownGene)


from <- 61310001
to <- from+2e4-1

ideogram.track <- IdeogramTrack(chromosome="chr11", genome="hg19")

genome.axis.track <- GenomeAxisTrack()

txTranscripts_v1 <- GeneRegionTrack(TxDb.Hsapiens.UCSC.hg19.knownGene, genome="hg19", chromosome="chr11", showId=TRUE, geneSymbol=TRUE, name="UCSC")
symbols <- unlist(mapIds(org.Hs.eg.db, gene(txTranscripts_v1), "SYMBOL", "ENTREZID", multiVals = "first"))
symbol(txTranscripts_v1) <- symbols[gene(txTranscripts_v1)]

snpLocations <- UcscTrack(genome = "hg19", chromosome = "chr11", track = "snp151Common", from = from, to = to, trackType = "AnnotationTrack", start = "chromStart", end = "chromEnd", id = "name",feature = "func", strand = "strand", shape = "box", stacking = "dense", fill = "black", name = "SNPs")

enh <- UcscTrack(genome = "hg19", chromosome = "chr11", track = "vistaEnhancers", table="vistaEnhancers", from = from, to = to, trackType = "AnnotationTrack", start = "chromStart", end = "chromEnd", id = "name", shape = "box", fill = "black", name = "Enhancer")


plotTracks(list(ideogram.track, genome.axis.track, txTranscripts_v1, snpLocations, enh), from = from, to = to, showTitle = TRUE)
ADD COMMENT

Login before adding your answer.

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