Question: Gviz UCSC tracks not visible
0
gravatar for s.koturan
27 days ago by
s.koturan0
s.koturan0 wrote:

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?

ADD COMMENTlink modified 27 days ago by Robert Ivanek650 • written 27 days ago by s.koturan0
Answer: Gviz UCSC tracks not visible
1
gravatar for Robert Ivanek
27 days ago by
Robert Ivanek650
Switzerland
Robert Ivanek650 wrote:

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 COMMENTlink written 27 days ago by Robert Ivanek650
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: 437 users visited in the last hour